<template>
  <div class="page">
    <h4 style="margin-left: 3px">基本信息筛选</h4>
    <el-row :gutter="20">
      <el-form id="formbox" ref="formInline" :inline="true" :model="formInline">
        <el-form-item label="姓名:" prop="name">
          <el-input
            v-model="formInline.name"
            placeholder="请输入姓名"
            clearable
          ></el-input>
        </el-form-item>
        <!-- @input.once="validateIdNumber" -->
        <el-form-item label="证件号码:" prop="cardNumber">
          <el-input
            v-model="formInline.cardNumber"
            placeholder="请输入证件号码"
            clearable
            :maxlength="18"
          ></el-input>
        </el-form-item>

        <el-form-item label="录入人:" prop="inputPerson">
          <el-input
            v-model="formInline.inputPerson"
            placeholder="请输入录入人"
            clearable
          ></el-input>
        </el-form-item>
        <!-- <el-form-item label="随访状态" prop="status">
            <el-select v-model="formInline.status" placeholder="">
              <el-option label="全部" value=""></el-option>
              <el-option label="待随访" value="待随访"></el-option>
              <el-option label="已随访" value="已随访"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="随访超时" prop="followTimeOut">
            <el-select v-model="formInline.followTimeOut" placeholder="">
              <el-option label="全部" value=""></el-option>
              <el-option label="是" value="是"></el-option>
              <el-option label="否" value="否"></el-option>
            </el-select>
          </el-form-item> -->
        <el-form-item label="随访类型:" prop="followType">
          <el-select
            v-model="formInline.followType"
            placeholder="请选择随访类型"
          >
            <el-option label="全部" value=""></el-option>
            <el-option label="季度随访" value="季度随访"></el-option>
            <el-option
              label="控制不满意增加随访"
              value="控制不满意增加随访"
            ></el-option>
            <el-option label="其他" value="其他"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="随访方式:" prop="followWay">
          <el-select
            v-model="formInline.followWay"
            placeholder="请选择随访方式"
          >
            <el-option label="全部" value=""></el-option>
            <el-option label="门诊" value="门诊"></el-option>
            <el-option label="家庭" value="家庭"></el-option>
            <el-option label="电话" value="电话"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="随访日期:" prop="followTime" class="time_selector">
          <!-- <el-date-picker
             style="width:252px"
              v-model="formInline.followTime"
              type="date"
              placeholder="选择日期"
              value-format="YYYY-MM-DD"
            ></el-date-picker> -->
          <el-date-picker
            style="width: 232px"
            v-model="formInline.followTime"
            :disabled-date="disableFutureDates"
            type="daterange"
            value-format="YYYY-MM-DD"
            format="YYYY-MM-DD"
            range-separator="-"
            start-placeholder="开始时间"
            end-placeholder="结束时间"
            size="large"
          />
        </el-form-item>
        <el-form-item label="采集状态:" prop="collectStatus" class="diseases">
          <el-select
            v-model="formInline.collectStatus"
            placeholder="请选择采集状态"
            clearable
          >
            <el-option label="采集成功" value="采集成功"></el-option>
            <el-option label="采集失败" value="采集失败"></el-option>
            <el-option label="未采集" value="未采集"></el-option>
            <!-- <el-option label="正在采集" value="正在采集"></el-option> -->
          </el-select>
        </el-form-item>
        <el-form-item
          label="回填状态:"
          prop="backFillingStatus"
          class="diseases"
        >
          <el-select
            v-model="formInline.backFillingStatus"
            placeholder="请选择回填状态"
            clearable
          >
            <el-option label="回填成功" value="回填成功"></el-option>
            <el-option label="回填失败" value="回填失败"></el-option>
            <el-option label="未回填" value="未回填"></el-option>
            <el-option label="已人工回填" value="已人工回填"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="病种:" prop="diseaseType" class="diseases">
          <el-select
            v-model="formInline.diseaseType"
            placeholder="请选择病种"
            clearable
          >
            <el-option label="高血压" value="高血压"></el-option>
            <el-option label="糖尿病" value="糖尿病"></el-option>
            <el-option label="高糖" value="高糖"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item
          label="高血压随访分类:"
          prop="classFollowHypertension"
          class="diseases"
        >
          <el-select
            v-model="formInline.classFollowHypertension"
            placeholder="请选择高血压随访分类"
            clearable
          >
            <el-option label="控制满意" value="控制满意"></el-option>
            <el-option label="控制不满意" value="控制不满意"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item
          label="糖尿病随访分类:"
          prop="classFollowDiabetes"
          class="diseases"
        >
          <el-select
            v-model="formInline.classFollowDiabetes"
            placeholder="请选择糖尿病随访分类"
            clearable
          >
            <el-option label="控制满意" value="控制满意"></el-option>

            <el-option label="控制不满意" value="控制不满意"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="随访医生:" prop="followDoctor">
          <el-input
            v-model="formInline.followDoctor"
            placeholder="请输入随访医生"
            clearable
          ></el-input>
        </el-form-item>
        <!-- <el-form-item  label="创建日期" prop="createTime" class="createTime">
            <el-date-picker
              v-model="formInline.startTime"
              type="date"
              placeholder="选择开始日期"
              value-format="YYYY-MM-DD"
            ></el-date-picker>
            <span>至</span>
            <el-date-picker
              v-model="formInline.endTime"
              type="date"
              placeholder="选择结束日期"
              value-format="YYYY-MM-DD"
            ></el-date-picker>
            
          </el-form-item> -->
        <el-form-item label="创建日期:" prop="createTime">
          <el-date-picker
            style="width: 232px"
            v-model="formInline.createTime"
            :disabled-date="disableFutureDates"
            type="daterange"
            value-format="YYYY-MM-DD"
            format="YYYY-MM-DD"
            range-separator="-"
            start-placeholder="开始时间"
            end-placeholder="结束时间"
            size="large"
          />
        </el-form-item>
        <!-- <el-form-item
            label="PAD导入日期："
            prop="nextFollowTimeHypertension"
            class="nextime"
          >
            <el-date-picker
              v-model="formInline.createTime"
              type="datetimerange"
              value-format="YYYY-MM-DD"
              format="YYYY-MM-DD"
              range-separator="-"
              start-placeholder="开始时间"
              end-placeholder="结束时间"
              size="large"
            />
          </el-form-item> -->

        <!-- <el-form-item  label="诊疗信息导入日期:" prop="inspectionDate">
            <el-date-picker
              style="width:252px"
              v-model="formInline.inspectionDate"
              type="date"
              placeholder="选择日期"
              value-format="YYYY-MM-DD"
            ></el-date-picker>
          </el-form-item> -->

        <el-form-item
          label="高血压下次随访日期:"
          prop="nextFollowTimeHypertension "
          class="nextime"
        >
          <!-- <el-date-picker
              style="width:252px"
              v-model="formInline.nextFollowTimeHypertension"
              type="date"
              placeholder="选择日期"
              value-format="YYYY-MM-DD"
            ></el-date-picker> -->
          <el-date-picker
            style="width: 232px"
            v-model="formInline.nextFollowTimeHypertension"
            type="daterange"
            value-format="YYYY-MM-DD"
            format="YYYY-MM-DD"
            range-separator="-"
            start-placeholder="开始时间"
            end-placeholder="结束时间"
            size="large"
          />
        </el-form-item>
        <el-form-item
          label="糖尿病下次随访日期:"
          prop="nextFollowTimeDiabete"
          class="nextime"
        >
          <!-- <el-date-picker
              style="width:252px"
              v-model="formInline.nextFollowTimeHypertension"
              type="date"
              placeholder="选择日期"
              value-format="YYYY-MM-DD"
            ></el-date-picker> -->
          <el-date-picker
            style="width: 232px"
            v-model="formInline.nextFollowTimeDiabete"
            type="daterange"
            value-format="YYYY-MM-DD"
            format="YYYY-MM-DD"
            range-separator="-"
            start-placeholder="开始时间"
            end-placeholder="结束时间"
            size="large"
          />
        </el-form-item>
        <el-form-item label="质控类型:" prop="qualityType">
          <el-select
            v-model="formInline.qualityType"
            placeholder="请选择质控类型"
          >
            <el-option label="全部" value=""></el-option>
            <el-option label="告警类" value="告警类"></el-option>
            <el-option label="错误类" value="错误类"></el-option>
          </el-select>
        </el-form-item>
        <el-col :span="24" style="display: flex; justify-content: flex-end">
          <el-form-item>
            <el-button type="primary" @click="onSubmit">查询</el-button>
            <el-button @click="onReset('formInline')">重置</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
    <el-row class="popover-container">
      <el-popover
        placement="left"
        width="100"
        trigger="click"
        class=""
        @hide="isPopOpen = false"
      >
        <!-- v-model="isPopOpen" -->
        <div class="popover-item-list">
          <h3>任务进度</h3>
          <div class="item-titel gradient-text">并发数:{{ concurrency }}台</div>
          <div class="item-titel gradient-text">采集中:{{ collecting }}条</div>
          <div class="item-titel gradient-text">更新中:{{ updating }}条</div>
        </div>

        <!-- <div class="arrow-container" slot="reference">
            <span class="arrow" :class="{ rotate: isPopOpen }">«</span>
          </div> -->
        <template #reference>
          <div class="arrow-container popover-content-list" slot="reference">
            <span
              class="arrow"
              :class="{ rotate: isPopOpen }"
              @click="isPopOpen = !isPopOpen"
              >«</span
            >
          </div>
        </template>
      </el-popover>
    </el-row>
    <el-row>
      <el-col :span="24"
        ><h4>随访记录 (共{{ total }}条)</h4></el-col
      >
      <el-col :span="24" style="display: flex">
        <el-col :span="4">
          <div class="table-btn">
            <div>
              <el-checkbox
                @change="checkedAllChange"
                v-model="checkedAll"
                :label="'全选'"
                :disabled="tableData.length == 0"
              />
            </div>
            <div style="margin-right: 10px">
              <label
                >已选择<el-text type="primary">{{
                  checkedAll == true ? selectionCount : multipleSelection.length
                }}</el-text
                >条</label
              >
            </div>
          </div>
        </el-col>
        <el-col :span="20" class="tr">
          <!-- <el-button
            :disabled="multipleSelection.length === 0"
            @click="exportSelect()"
            >导出选中</el-button
          >
          <el-button type="primary" @click="exportRecord()" 
            >导出全部</el-button
          > -->

          <router-link to="/follow/main" style="margin-right: 10px">
            <el-button type="primary">新增随访</el-button>
          </router-link>
          <el-button
            type="primary"
            :disabled="multipleSelection.length === 0"
            @click="manualBackfilling()"
            >已人工回填</el-button
          >
          <el-button
            style="width: 83px"
            type="primary"
            :disabled="multipleSelection.length === 0"
            @click="exportSelect()"
            >导出</el-button
          >
          <el-button
            :disabled="multipleSelection.length === 0"
            type="primary"
            @click="testSt()"
            >数据采集</el-button
          >
          <el-button
            :disabled="multipleSelection.length === 0"
            type="primary"
            @click="showUpload()"
            >更新HIS</el-button
          >
        </el-col>
      </el-col>
    </el-row>

    <el-empty
      v-if="!tableData.length"
      :image-size="200"
      description="暂无记录"
    ></el-empty>
    <el-row ref="listWrap" v-else class="tb">
      <el-popover
        ref="popoverRef"
        placement="bottom-end"
        width="186"
        v-model="popoverVisible"
        @hide="handlePopoverClose"
        class="popover-content"
      >
        <div class="popover-item">
          <!-- 控制字段显示的复选框列表 -->
          <div v-for="(column, index) in columns" :key="column.label">
            <el-checkbox v-model="tempVisibility[index]">{{
              column.label
            }}</el-checkbox>
          </div>
        </div>
        <div class="popover-footer">
          <el-button @click="applyColumnVisibility" type="primary" size="small"
            >确定</el-button
          >
          <el-button @click="applyReset" type="default" size="small"
            >重置</el-button
          >
        </div>
        <template #reference>
          <el-icon class="setting"><Setting /></el-icon>
        </template>
      </el-popover>
      <el-table
        ref="multipleTableRef"
        border
        :data="tableData"
        style="width: 100%"
        table-layout="auto"
        max-height="500"
        class="tableAuto"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55" align="center">
        </el-table-column>
        <el-table-column
          type="index"
          label="序号"
          width="80"
          align="center"
          fixed
        />
        <el-table-column
          fixed
          prop="name"
          show-overflow-tooltip
          label="姓名"
          align="center"
          width="120"
        >
        </el-table-column>

        <el-table-column
          prop="cardNumber"
          width="180"
          label="证件号码"
          align="center"
          fixed
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'cardNumber')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "cardNumber")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'cardNumber').type
                  "
                >
                  <span></span>
                  {{ scope.row.cardNumber }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column prop="gender" label="性别" align="center" width="80">
        </el-table-column>
        <el-table-column
          prop="followTime"
          width="130"
          label="随访日期"
          align="center"
        >
        </el-table-column>
        <!-- <el-table-column
            prop="phoneNumber"
            label="手机号">
          </el-table-column> -->
        <el-table-column
          prop="followType"
          width="150"
          show-overflow-tooltip
          label="随访类型"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="followWay"
          show-overflow-tooltip
          label="随访方式"
          width="120"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="collectStatus"
          show-overflow-tooltip
          label="采集状态"
          align="center"
          width="120"
          v-if="isColumnVisible('采集状态')"
        >
          <template #default="{ row }">
            <el-popover
              v-if="row.collectStatus === '采集失败'"
              :content="row.collectErrorInfo"
              trigger="hover"
              placement="top"
            >
              <template #reference>
                <span>
                  {{ row.collectStatus }}
                </span>
              </template>
            </el-popover>
            <span v-else>
              {{ row.collectStatus }}
            </span>
          </template>
        </el-table-column>
        <el-table-column
          prop="backFillingStatus"
          show-overflow-tooltip
          label="回填状态"
          align="center"
          width="120"
          v-if="isColumnVisible('回填状态')"
        >
          <template #default="{ row }">
            <el-popover
              v-if="row.backFillingStatus === '回填失败'"
              :content="row.backFillingErrorInfo"
              trigger="hover"
              placement="top"
            >
              <template #reference>
                <span>
                  {{ row.backFillingStatus }}
                </span>
              </template>
            </el-popover>
            <span v-else>
              {{ row.backFillingStatus }}
            </span>
          </template>
        </el-table-column>
        <!-- <el-table-column
            prop="address"
            label="现住址">
          </el-table-column> -->
        <el-table-column
          prop="inputPerson"
          label="录入人"
          show-overflow-tooltip
          v-if="isColumnVisible('录入人')"
          align="center"
          width="120"
        >
        </el-table-column>

        <el-table-column
          prop="followDoctor"
          label="随访医生"
          width="120"
          show-overflow-tooltip
          v-if="isColumnVisible('随访医生')"
        >
        </el-table-column>
        <!-- <el-table-column
          prop="responsibleDoctor"
          label="家庭医生"
          width="120"
          show-overflow-tooltip
          v-if="isColumnVisible('家庭医生')"
        >
        </el-table-column> -->
        <el-table-column
          prop="diseaseType"
          show-overflow-tooltip
          width="120"
          label="病种"
          align="center"
          v-if="isColumnVisible('病种')"
        >
          <!-- <template  #default="scope">
              <span>{{ getDiseaseType(scope.row) }}</span>
            </template> -->
        </el-table-column>
        <el-table-column
          prop="symptomHypertension"
          width="180"
          show-overflow-tooltip
          label="高血压症状"
          align="center"
          v-if="isColumnVisible('高血压症状')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="
                getStatus(scope.row, 'symptomHypertension')?.desc !== '正常'
              "
            >
              <template #default>
                <p>{{ getStatus(scope.row, "symptomHypertension")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'symptomHypertension').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "symptomHypertension")?.status }}
                  </span>
                  {{ scope.row.symptomHypertension }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="symptomsDiabetes"
          width="180"
          show-overflow-tooltip
          label="糖尿病症状"
          align="center"
          v-if="isColumnVisible('糖尿病症状')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'symptomsDiabetes')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "symptomsDiabetes")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'symptomsDiabetes').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "symptomsDiabetes")?.status }}
                  </span>
                  {{ scope.row.symptomsDiabetes }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <!-- <el-table-column
            prop="birthday"
            label="出生日期">
          </el-table-column> -->
        <!-- <el-table-column
            prop="followStatus"
            label="随访状态">
          </el-table-column> -->
        <!-- <el-table-column
            prop="followTimeOut"
            label="是否随访超时">
          </el-table-column> -->
        <el-table-column
          prop="bloodPressure"
          show-overflow-tooltip
          label="血压"
          align="center"
          v-if="isColumnVisible('血压')"
          width="130"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'bloodPressure')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "bloodPressure")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'bloodPressure').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "bloodPressure")?.status }}
                  </span>
                  {{ scope.row.bloodPressure }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <!-- <el-table-column
            prop="temperature"
            label="体温">
            <template  #default="scope">
              <el-popover trigger="hover" placement="top">
                <p>{{ getStatus(scope.row, 'temperature')?.desc }}</p>
                <div slot="reference" :class="'name-wrapper name-wrapper' + getStatus(scope.row, 'temperature').type">
                  <span>{{ getStatus(scope.row, 'temperature')?.status }} </span>
                  {{  scope.row.temperature  }}
                </div>
              </el-popover>
            </template>
          </el-table-column> -->
        <!-- <el-table-column
            prop="pulseRate"
            label="脉率">
            <template  #default="scope">
              <el-popover trigger="hover" placement="top">
                <p>{{ getStatus(scope.row, 'pulseRate')?.desc }}</p>
                <div slot="reference" :class="'name-wrapper name-wrapper' + getStatus(scope.row, 'pulseRate').type">
                  <span>{{ getStatus(scope.row, 'pulseRate')?.status }} </span>
                  {{  scope.row.pulseRate  }}
                </div>
              </el-popover>
            </template>
          </el-table-column> -->
        <el-table-column
          prop="heartRate"
          width="130"
          label="心率"
          align="center"
          v-if="isColumnVisible('心率')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'heartRate')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "heartRate")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'heartRate').type
                  "
                >
                  <span>{{ getStatus(scope.row, "heartRate")?.status }} </span>
                  {{ scope.row.heartRate }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="height"
          width="130"
          label="身高"
          align="center"
          v-if="isColumnVisible('身高')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'height')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "height")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'height').type
                  "
                >
                  <span>{{ getStatus(scope.row, "height")?.status }} </span>
                  {{ scope.row.height }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="weight"
          width="130"
          label="体重"
          align="center"
          v-if="isColumnVisible('体重')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'weight')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "weight")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'weight').type
                  "
                >
                  <span>{{ getStatus(scope.row, "weight")?.status }} </span>
                  {{ scope.row.weight }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="targetWeight"
          label="目标体重"
          align="center"
          width="120"
          show-overflow-tooltip
          v-if="isColumnVisible('目标体重')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'targetWeight')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "targetWeight")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'targetWeight').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "targetWeight")?.status }}
                  </span>
                  {{ scope.row.targetWeight }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="bmi"
          width="130"
          label="体质指数"
          align="center"
          v-if="isColumnVisible('体质指数')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'bmi')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "bmi")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'bmi').type
                  "
                >
                  <span>{{ getStatus(scope.row, "bmi")?.status }} </span>
                  {{ scope.row.bmi }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          prop="arteryPulsation"
          width="130"
          label="足背动脉搏动"
          align="center"
          v-if="isColumnVisible('足背动脉搏动')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'arteryPulsation')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "arteryPulsation")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'arteryPulsation').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "arteryPulsation")?.status }}
                  </span>
                  {{ scope.row.arteryPulsation }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="waist"
          width="130"
          label="腰围"
          align="center"
          v-if="isColumnVisible('腰围')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'waist')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "waist")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'waist').type
                  "
                >
                  <span>{{ getStatus(scope.row, "waist")?.status }} </span>
                  {{ scope.row.waist }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="dailySmoking"
          width="100"
          label="日常吸烟量"
          align="center"
          v-if="isColumnVisible('日常吸烟量')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'dailySmoking')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "dailySmoking")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'dailySmoking').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "dailySmoking")?.status }}
                  </span>
                  {{ scope.row.dailySmoking }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="targetSmoking"
          width="100"
          label="目标吸烟量"
          align="center"
          v-if="isColumnVisible('目标吸烟量')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'targetSmoking')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "targetSmoking")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'targetSmoking').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "targetSmoking")?.status }}
                  </span>
                  {{ scope.row.targetSmoking }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="dailyDrink"
          width="100"
          show-overflow-tooltip
          label="日常饮酒量"
          align="center"
          v-if="isColumnVisible('日常饮酒量')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'dailyDrink')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "dailyDrink")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'dailyDrink').type
                  "
                >
                  <span>{{ getStatus(scope.row, "dailyDrink")?.status }} </span>
                  {{ scope.row.dailyDrink }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="targetDrink"
          width="100"
          show-overflow-tooltip
          label="目标饮酒量"
          align="center"
          v-if="isColumnVisible('目标饮酒量')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'targetDrink')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "targetDrink")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'targetDrink').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "targetDrink")?.status }}
                  </span>
                  {{ scope.row.targetDrink }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="dailyExercise"
          width="140"
          show-overflow-tooltip
          label="运动量"
          align="center"
          v-if="isColumnVisible('运动量')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'dailyExercise')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "dailyExercise")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'dailyExercise').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "dailyExercise")?.status }}
                  </span>
                  {{ scope.row.dailyExercise }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="targetExercise"
          width="140"
          show-overflow-tooltip
          label="目标运动量"
          align="center"
          v-if="isColumnVisible('目标运动量')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'targetExercise')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "targetExercise")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'targetExercise').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "targetExercise")?.status }}
                  </span>
                  {{ scope.row.targetExercise }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="saltRelated"
          width="100"
          show-overflow-tooltip
          label="摄盐情况"
          align="center"
          v-if="isColumnVisible('摄盐情况')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'saltRelated')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "saltRelated")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'saltRelated').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "saltRelated")?.status }}
                  </span>
                  {{ scope.row.saltRelated }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="targetRelated"
          width="120"
          show-overflow-tooltip
          label="目标摄盐量"
          align="center"
          v-if="isColumnVisible('目标摄盐量')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'targetRelated')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "targetRelated")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'targetRelated').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "targetRelated")?.status }}
                  </span>
                  {{ scope.row.targetRelated }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="psychological"
          show-overflow-tooltip
          label="心理调整"
          align="center"
          width="120"
          v-if="isColumnVisible('心理调整')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'psychological')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "psychological")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'psychological').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "psychological")?.status }}
                  </span>
                  {{ scope.row.psychological }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <!-- <el-table-column
            prop="stapleFoodName"
            width="120"
           show-overflow-tooltip
            label="主食名称">
            <template  #default="scope">
              <el-popover trigger="hover" placement="top">
                <p>{{ getStatus(scope.row, 'stapleFoodName')?.desc }}</p>
                <div slot="reference" :class="'name-wrapper name-wrapper' + getStatus(scope.row, 'stapleFoodName').type">
                  <span>{{ getStatus(scope.row, 'stapleFoodName')?.status }} </span>
                  {{  scope.row.stapleFoodName  }}
                </div>
              </el-popover>
            </template>
          </el-table-column> -->
        <el-table-column
          prop="stapleFood"
          width="120"
          show-overflow-tooltip
          label="主食量"
          align="center"
          v-if="isColumnVisible('主食量')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'stapleFood')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "stapleFood")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'stapleFood').type
                  "
                >
                  <span>{{ getStatus(scope.row, "stapleFood")?.status }} </span>
                  {{ scope.row.stapleFood }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="targetStapleFood"
          width="150"
          show-overflow-tooltip
          label="目标主食量"
          align="center"
          v-if="isColumnVisible('目标主食量')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'targetStapleFood')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "targetStapleFood")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'targetStapleFood').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "targetStapleFood")?.status }}
                  </span>
                  {{ scope.row.targetStapleFood }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="complianceBehavior"
          width="120"
          show-overflow-tooltip
          label="遵医行为"
          align="center"
          v-if="isColumnVisible('遵医行为')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'complianceBehavior')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "complianceBehavior")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'complianceBehavior').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "complianceBehavior")?.status }}
                  </span>
                  {{ scope.row.complianceBehavior }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="fastingBloodGlucose"
          width="120"
          show-overflow-tooltip
          label="空腹血糖"
          align="center"
          v-if="isColumnVisible('空腹血糖')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="
                getStatus(scope.row, 'fastingBloodGlucose')?.desc !== '正常'
              "
            >
              <template #default>
                <p>{{ getStatus(scope.row, "fastingBloodGlucose")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'fastingBloodGlucose').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "fastingBloodGlucose")?.status }}
                  </span>
                  {{ scope.row.fastingBloodGlucose }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="glycosylatedHemoglobin"
          width="180"
          show-overflow-tooltip
          label="糖化血红蛋白"
          align="center"
          v-if="isColumnVisible('糖化血红蛋白')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="
                getStatus(scope.row, 'glycosylatedHemoglobin')?.desc !== '正常'
              "
            >
              <template #default>
                <p>
                  {{ getStatus(scope.row, "glycosylatedHemoglobin")?.desc }}
                </p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'glycosylatedHemoglobin').type
                  "
                >
                  <span
                    >{{
                      getStatus(scope.row, "glycosylatedHemoglobin")?.status
                    }}
                  </span>
                  {{ scope.row.glycosylatedHemoglobin }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="inspectionDate"
          width="150"
          show-overflow-tooltip
          label="检查日期"
          align="center"
          v-if="isColumnVisible('检查日期')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'inspectionDate')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "inspectionDate")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'inspectionDate').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "inspectionDate")?.status }}
                  </span>
                  {{ scope.row.inspectionDate }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="randomBloodGlucose"
          width="150"
          show-overflow-tooltip
          label="其他(随机血糖)"
          align="center"
          v-if="isColumnVisible('其他(随机血糖)')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'randomBloodGlucose')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "randomBloodGlucose")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'randomBloodGlucose').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "randomBloodGlucose")?.status }}
                  </span>
                  {{ scope.row.randomBloodGlucose }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="medicationComplianceHypertension"
          width="150"
          show-overflow-tooltip
          label="高血压服药依从性"
          align="center"
          v-if="isColumnVisible('高血压服药依从性')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="
                getStatus(scope.row, 'medicationComplianceHypertension')
                  ?.desc !== '正常'
              "
            >
              <template #default>
                <p>
                  {{
                    getStatus(scope.row, "medicationComplianceHypertension")
                      ?.desc
                  }}
                </p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'medicationComplianceHypertension')
                      .type
                  "
                >
                  <span
                    >{{
                      getStatus(scope.row, "medicationComplianceHypertension")
                        ?.status
                    }}
                  </span>
                  {{ scope.row.medicationComplianceHypertension }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="medicationComplianceDiabetes"
          width="150"
          show-overflow-tooltip
          label="糖尿病服药依从性"
          align="center"
          v-if="isColumnVisible('糖尿病服药依从性')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="
                getStatus(scope.row, 'medicationComplianceDiabetes')?.desc !==
                '正常'
              "
            >
              <template #default>
                <p>
                  {{
                    getStatus(scope.row, "medicationComplianceDiabetes")?.desc
                  }}
                </p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'medicationComplianceDiabetes').type
                  "
                >
                  <span
                    >{{
                      getStatus(scope.row, "medicationComplianceDiabetes")
                        ?.status
                    }}
                  </span>
                  {{ scope.row.medicationComplianceDiabetes }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="hypoglycemicReactions"
          width="150"
          show-overflow-tooltip
          label="低血糖反应"
          align="center"
          v-if="isColumnVisible('低血糖反应')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="
                getStatus(scope.row, 'hypoglycemicReactions')?.desc !== '正常'
              "
            >
              <template #default>
                <p>{{ getStatus(scope.row, "hypoglycemicReactions")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'hypoglycemicReactions').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "hypoglycemicReactions")?.status }}
                  </span>
                  {{ scope.row.hypoglycemicReactions }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="adverseDrugReactions"
          width="150"
          show-overflow-tooltip
          label="药物不良反应"
          align="center"
          v-if="isColumnVisible('药物不良反应')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="
                getStatus(scope.row, 'adverseDrugReactions')?.desc !== '正常'
              "
            >
              <template #default>
                <p>{{ getStatus(scope.row, "adverseDrugReactions")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'adverseDrugReactions').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "adverseDrugReactions")?.status }}
                  </span>
                  {{ scope.row.adverseDrugReactions }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="classFollowHypertension"
          width="150"
          show-overflow-tooltip
          label="高血压随访分类"
          align="center"
          v-if="isColumnVisible('高血压随访分类')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="
                getStatus(scope.row, 'classFollowHypertension')?.desc !== '正常'
              "
            >
              <template #default>
                <p>
                  {{ getStatus(scope.row, "classFollowHypertension")?.desc }}
                </p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'classFollowHypertension').type
                  "
                >
                  <span
                    >{{
                      getStatus(scope.row, "classFollowHypertension")?.status
                    }}
                  </span>
                  {{ scope.row.classFollowHypertension }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="classFollowDiabetes"
          width="150"
          show-overflow-tooltip
          label="糖尿病随访分类"
          align="center"
          v-if="isColumnVisible('糖尿病随访分类')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="
                getStatus(scope.row, 'classFollowDiabetes')?.desc !== '正常'
              "
            >
              <template #default>
                <p>{{ getStatus(scope.row, "classFollowDiabetes")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'classFollowDiabetes').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "classFollowDiabetes")?.status }}
                  </span>
                  {{ scope.row.classFollowDiabetes }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="medicationSituation"
          width="200"
          align="center"
          show-overflow-tooltip
          label="用药情况"
          v-if="isColumnVisible('用药情况')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="
                getStatus(scope.row, 'medicationSituation')?.desc !== '正常'
              "
            >
              <p>{{ getStatus(scope.row, "medicationSituation")?.desc }}</p>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'medicationSituation').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "medicationSituation")?.status }}
                  </span>
                  {{ getDrug(scope.row.medicationSituation) }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <!-- <el-table-column
          prop="hypertensionMedicationSituation"
          width="200"
          show-overflow-tooltip
          label="用药情况"
          align="center"
          v-if="isColumnVisible('用药情况')"
        >
          <template #default="scope">
            <el-popover trigger="hover" placement="top">
              <template #default>
                <p>
                  {{
                    getStatus(scope.row, "hypertensionMedicationSituation")
                      ?.desc
                  }}
                </p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'hypertensionMedicationSituation').type
                  "
                >
                  <span
                    >{{
                      getStatus(scope.row, "hypertensionMedicationSituation")
                        ?.status
                    }}
                  </span>
                  {{ getDrug(scope.row.hypertensionMedicationSituation) }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column> -->
        <!-- <el-table-column
            prop="diabetesMedicationSituation"
            width="150"
           show-overflow-tooltip
            label="糖尿病用药情况"
          >
            <template  #default="scope">
              <el-popover trigger="hover" placement="top">
                <p>{{ getStatus(scope.row, "diabetesMedicationSituation")?.desc }}</p>
                <div
                  
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'diabetesMedicationSituation').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "diabetesMedicationSituation")?.status }}
                  </span>
                  {{ getDrug(scope.row.diabetesMedicationSituation) }}
                </div>
              </el-popover>
            </template>
          </el-table-column> -->
        <el-table-column
          prop="referralReason"
          width="150"
          show-overflow-tooltip
          label="转诊原因"
          align="center"
          v-if="isColumnVisible('转诊原因')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'referralReason')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "referralReason")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'referralReason').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "referralReason")?.status }}
                  </span>
                  {{ scope.row.referralReason }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="referralInstitution"
          width="150"
          show-overflow-tooltip
          label="机构及科别"
          align="center"
          v-if="isColumnVisible('机构及科别')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="
                getStatus(scope.row, 'referralInstitution')?.desc !== '正常'
              "
            >
              <template #default>
                <p>{{ getStatus(scope.row, "referralInstitution")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'referralInstitution').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "referralInstitution")?.status }}
                  </span>
                  {{ scope.row.referralInstitution }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="createTime"
          width="150"
          show-overflow-tooltip
          label="创建日期"
          align="center"
          v-if="isColumnVisible('创建日期')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'createTime')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "createTime")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'createTime').type
                  "
                >
                  <span>{{ getStatus(scope.row, "createTime")?.status }} </span>
                  {{ scope.row.createTime }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="diagnosisTime"
          width="150"
          show-overflow-tooltip
          label="诊疗信息导入日期"
          align="center"
          v-if="isColumnVisible('诊疗信息导入日期')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'diagnosisTime')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "diagnosisTime")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'diagnosisTime').type
                  "
                >
                  <span
                    >{{ getStatus(scope.row, "diagnosisTime")?.status }}
                  </span>
                  {{ scope.row.diagnosisTime }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="nextFollowTimeHypertension"
          width="180"
          show-overflow-tooltip
          label="高血压下次随访日期"
          align="center"
          v-if="isColumnVisible('高血压下次随访日期')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="
                getStatus(scope.row, 'nextFollowTimeHypertension')?.desc !==
                '正常'
              "
            >
              <template #default>
                <p>
                  {{ getStatus(scope.row, "nextFollowTimeHypertension")?.desc }}
                </p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'nextFollowTimeHypertension').type
                  "
                >
                  <span
                    >{{
                      getStatus(scope.row, "nextFollowTimeHypertension")?.status
                    }}
                  </span>
                  {{ scope.row.nextFollowTimeHypertension }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="nextFollowTimeDiabetes"
          width="180"
          show-overflow-tooltip
          label="糖尿病下次随访日期"
          align="center"
          v-if="isColumnVisible('糖尿病下次随访日期')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="
                getStatus(scope.row, 'nextFollowTimeDiabetes')?.desc !== '正常'
              "
            >
              <template #default>
                <p>
                  {{ getStatus(scope.row, "nextFollowTimeDiabetes")?.desc }}
                </p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'nextFollowTimeDiabetes').type
                  "
                >
                  <span
                    >{{
                      getStatus(scope.row, "nextFollowTimeDiabetes")?.status
                    }}
                  </span>
                  {{ scope.row.nextFollowTimeDiabetes }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="insulin"
          width="150"
          show-overflow-tooltip
          label="胰岛素"
          align="center"
          v-if="isColumnVisible('胰岛素')"
        >
          <template #default="scope">
            <el-popover
              trigger="hover"
              placement="top"
              v-if="getStatus(scope.row, 'insulin')?.desc !== '正常'"
            >
              <template #default>
                <p>{{ getStatus(scope.row, "insulin")?.desc }}</p>
              </template>
              <template #reference>
                <div
                  :class="
                    'name-wrapper name-wrapper' +
                    getStatus(scope.row, 'insulin').type
                  "
                >
                  <span>{{ getStatus(scope.row, "insulin")?.status }} </span>
                  {{ getDrug2(scope.row.insulin) }}
                </div>
              </template>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          fixed="right"
          label="操作"
          width="150"
          align="center"
          header-align="left"
        >
          <template #default="scope">
            <el-button
              type="primary"
              text
              size="small"
              @click.native.prevent="showRow(scope.$index)"
            >
              编辑
            </el-button>
            <el-button
              text
              size="small"
              style="color: #ff0000"
              @click.native.prevent="deleRow(scope.$index)"
            >
              删除
            </el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-row>
    <el-col
      :span="24"
      style="
        display: flex;
        justify-content: end;
        margin-top: 30px;
        margin-bottom: 50px;
      "
    >
      <el-pagination
        v-model:currentPage="currentPage"
        v-model:page-size="size"
        :total="total"
        :page-sizes="[10, 20, 50, 100, 500]"
        class="new-pagination"
        small
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        layout="total, sizes, prev, pager, next, jumper"
      />
    </el-col>
    <!-- <el-row style="padding: 10px 0; text-align: right">
          <el-pagination
            :page-sizes="[10, 30, 50, 100]"
            :current-page.sync="currentPage"
            layout="sizes, prev, pager, next"
            :total="total"
            :page-size="size"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
          >
          </el-pagination>
        </el-row> -->
    <el-dialog
      title="编辑"
      v-model="dialogDescVisible"
      width="70vw"
      class="dialog-box"
    >
      <div style="height: 500px; overflow-y: auto">
        <el-form
          ref="ruleForm"
          :model="ruleForm"
          :rules="rules"
          label-position="top"
          class="demo-ruleForm"
        >
          <h4>基本信息</h4>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="姓名" prop="name">
                <el-input v-model="ruleForm.name" :disabled="true"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="联系电话" prop="phoneNumber">
                <el-input
                  v-model="ruleForm.phoneNumber"
                  :disabled="true"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item prop="cardType" label="证件类型">
                <el-select
                  disabled
                  v-model="ruleForm.cardType"
                  placeholder="请选择证件类型"
                  style="width: 100%"
                  class="codeTypeInput"
                >
                  <el-option label="居民身份证" value="居民身份证"></el-option>
                  <el-option
                    label="港澳台居民身份证"
                    value="港澳台居民身份证"
                  ></el-option>
                  <el-option
                    label="外国人永久居留身份证"
                    value="外国人永久居留身份证"
                  ></el-option>
                  <el-option
                    label="港澳台居民居住证"
                    value="港澳台居民居住证"
                  ></el-option>
                  <el-option label="居民户口本" value="居民户口本"></el-option>
                  <el-option label="护照" value="护照"></el-option>
                  <el-option label="军官证" value="军官证"></el-option>
                  <el-option label="文职干部证" value="文职干部证"></el-option>
                  <el-option label="士兵证" value="士兵证"></el-option>
                  <el-option label="驾驶执照" value="驾驶执照"></el-option>
                  <el-option label="出生证" value="出生证"></el-option>
                  <el-option label="其他" value="其他"></el-option>
                  <el-option label="儿保卡" value="儿保卡"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="证件号码" prop="cardNumber">
                <el-input
                  v-model="ruleForm.cardNumber"
                  :disabled="true"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="出生日期" prop="birthday">
                <el-date-picker
                  v-model="ruleForm.birthday"
                  type="date"
                  placeholder="选择日期"
                  style="width: 100%"
                  :disabled="true"
                  value-format="YYYY-MM-DD"
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="性别" prop="gender">
                <el-radio
                  v-model="ruleForm.gender"
                  class="el-radio-n"
                  label="男"
                  value="男"
                  border
                  :disabled="true"
                  >男</el-radio
                >
                <el-radio
                  v-model="ruleForm.gender"
                  class="el-radio-n"
                  label="女"
                  value="女"
                  border
                  :disabled="true"
                  >女</el-radio
                >
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="联系人姓名" prop="contactsName">
                <el-input
                  v-model="ruleForm.contactsName"
                  :disabled="true"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="联系人电话" prop="contactsPhoneNumber">
                <el-input
                  v-model="ruleForm.contactsPhoneNumber"
                  :disabled="true"
                ></el-input>
              </el-form-item>
            </el-col>

            <!-- <el-col :span="12">
              <el-form-item label="过敏史" prop="allergy">
                <el-input v-model="ruleForm.allergy"></el-input>
              </el-form-item>
            </el-col> -->
          </el-row>
          <el-form-item label="现住址" prop="address">
            <el-input
              v-model="ruleForm.address"
              type="textarea"
              :disabled="true"
            ></el-input>
          </el-form-item>
          <el-form-item label="户籍地址" prop="domicileAddress">
            <el-input
              v-model="ruleForm.domicileAddress"
              type="textarea"
              :disabled="true"
            ></el-input>
          </el-form-item>
          <el-form-item label="随访类型" prop="followType">
            <el-radio-group v-model="ruleForm.followType">
              <el-radio label="季度随访" value="季度随访"></el-radio>
              <el-radio
                label="控制不满意增加随访"
                value="控制不满意增加随访"
              ></el-radio>
              <el-radio label="其他" value="其他"></el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item
            v-show="ruleForm.followType == '其他'"
            label=""
            prop="followTypeOther"
          >
            <!-- :disabled="ruleForm.followType !== '其他'" -->
            <el-input v-model="ruleForm.followTypeOther">
              <template v-slot:prepend>其他</template>
            </el-input>
          </el-form-item>
          <el-form-item label="随访方式" prop="followWay">
            <el-radio-group v-model="ruleForm.followWay">
              <el-radio label="门诊" name="followWay" value="门诊"></el-radio>
              <el-radio label="家庭" name="followWay" value="家庭"></el-radio>
              <el-radio label="电话" name="followWay" value="电话"></el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="录入人" prop="inputPerson">
            <el-input
              v-model="ruleForm.inputPerson"
              :disabled="true"
            ></el-input>
          </el-form-item>
          <el-form-item label="随访医生" prop="followDoctor">
            <el-input
              v-model="ruleForm.followDoctor"
              :disabled="true"
            ></el-input>
          </el-form-item>
          <!-- <el-form-item label="家庭医生" prop="responsibleDoctor">
            <el-input
              v-model="ruleForm.responsibleDoctor"
              :disabled="true"
            ></el-input>
          </el-form-item> -->
          <el-form-item label="随访日期" prop="followTime">
            <el-date-picker
              v-model="ruleForm.followTime"
              :disabled-date="disableFutureDates"
              type="date"
              placeholder="选择日期"
              style="width: 100%"
              value-format="YYYY-MM-DD"
              :clearable="false"
            ></el-date-picker>
          </el-form-item>
          <el-form-item label="" prop="createTime">
            <el-input
              v-model="ruleForm.createTime"
              placeholder=""
              :disabled="true"
            >
              <template v-slot:prepend>创建日期</template>
            </el-input>
          </el-form-item>
          <el-form-item label="" prop="inspectionDate">
            <el-input
              v-model="ruleForm.inspectionDate"
              placeholder=""
              :disabled="true"
            >
              <template v-slot:prepend>诊疗信息导入日期</template>
            </el-input>
          </el-form-item>
          <h4 id="bz">病种及症状</h4>
          <el-form-item label="" class="border" prop="issymptom">
            <el-checkbox @change="issymptomChange" v-model="ruleForm.issymptom"
              >高血压</el-checkbox
            >
          </el-form-item>
          <el-form-item
            v-show="ruleForm.issymptom"
            @change="symptomChange"
            label=""
            prop="symptomHypertension"
          >
            <el-checkbox-group
              v-model="ruleForm.symptomHypertension"
              @change="symptomChange"
            >
              <el-checkbox
                label="无症状"
                value="无症状"
                @change="symptomChange1"
              ></el-checkbox>
              <el-checkbox
                @change="syChange"
                label="头痛头晕"
                value="头痛头晕"
              ></el-checkbox>
              <el-checkbox
                @change="syChange"
                label="恶心呕吐"
                value="恶心呕吐"
              ></el-checkbox>
              <el-checkbox
                @change="syChange"
                label="眼花耳鸣"
                value="眼花耳鸣"
              ></el-checkbox>
              <el-checkbox
                @change="syChange"
                label="呼吸困难"
                value="呼吸困难"
              ></el-checkbox>
              <el-checkbox
                @change="syChange"
                label="心悸胸闷"
                value="心悸胸闷"
              ></el-checkbox>
              <el-checkbox
                @change="syChange"
                label="鼻衄出血不止"
              ></el-checkbox>
              <el-checkbox
                @change="syChange"
                label="四肢发麻"
                value="四肢发麻"
              ></el-checkbox>
              <el-checkbox
                @change="syChange"
                label="下肢水肿"
                value="下肢水肿"
              ></el-checkbox>
              <el-checkbox
                @change="syChange"
                label="其他"
                value="其他"
              ></el-checkbox>
            </el-checkbox-group>
          </el-form-item>
          <el-form-item
            v-show="showSymptomOther && ruleForm.issymptom"
            label=""
            prop="symptomOther"
          >
            <el-input v-model="ruleForm.symptomOther">
              <template v-slot:prepend>其他</template>
            </el-input>
          </el-form-item>
          <el-form-item label="" class="border" prop="issymptomsDiabetes">
            <el-checkbox
              @change="issymptomsDiabetesChange"
              v-model="ruleForm.issymptomsDiabetes"
              >糖尿病</el-checkbox
            >
          </el-form-item>
          <el-form-item
            v-show="ruleForm.issymptomsDiabetes"
            label=""
            prop="symptomsDiabetes"
          >
            <el-checkbox-group
              v-model="ruleForm.symptomsDiabetes"
              @change="symptomsDiabetesChange"
            >
              <el-checkbox
                label="无症状"
                value="无症状"
                @change="symptomsDiabetesChangewu"
              ></el-checkbox>
              <el-checkbox
                @change="syChange1"
                label="多饮"
                value="多饮"
              ></el-checkbox>
              <el-checkbox
                @change="syChange1"
                label="多食"
                value="多食"
              ></el-checkbox>
              <el-checkbox
                @change="syChange1"
                label="多尿"
                value="多尿"
              ></el-checkbox>
              <el-checkbox
                @change="syChange1"
                label="视力模糊"
                value="视力模糊"
              ></el-checkbox>
              <el-checkbox
                @change="syChange1"
                label="感染"
                value="感染"
              ></el-checkbox>
              <el-checkbox
                @change="syChange1"
                label="手脚麻木"
                value="手脚麻木"
              ></el-checkbox>
              <el-checkbox
                @change="syChange1"
                label="下肢浮肿"
                value="下肢浮肿"
              ></el-checkbox>
              <el-checkbox
                @change="syChange1"
                label="体重明显下降"
                value="体重明显下降"
              ></el-checkbox>
              <el-checkbox
                @change="syChange1"
                label="其他"
                value="其他"
              ></el-checkbox>
            </el-checkbox-group>
          </el-form-item>
          <el-form-item
            v-show="showSymptomsDiabetesOther && ruleForm.issymptomsDiabetes"
            label=""
            prop="symptomsDiabetesOther"
            id="issympt"
          >
            <el-input v-model="ruleForm.symptomsDiabetesOther">
              <template v-slot:prepend>其他</template>
            </el-input>
          </el-form-item>
          <h4 id="yb">一般情况</h4>
          <!-- <el-form-item label="" prop="temperature">
            <el-input v-model="ruleForm.temperature">
              <template   v-slot:prepend
                ><span style="color: #ff0000">*</span> 体温</template
              >
              <template v-slot:append>℃</template>
            </el-input>
          </el-form-item> -->
          <!-- <el-form-item label="" prop="pulseRate">
            <el-input v-model="ruleForm.pulseRate">
              <template   v-slot:prepend><span style="color: #ff0000;">*</span> 脉率</template>
              <template v-slot:append>次/分</template>
            </el-input>
          </el-form-item> -->

          <el-form-item label="" prop="height">
            <el-input
              v-model="ruleForm.height"
              @blur="calcTargetWeight"
              :maxLength="5"
            >
              <template v-slot:prepend
                ><span style="color: #ff0000">*</span> 身高</template
              >
              <template v-slot:append>cm</template>
            </el-input>
          </el-form-item>
          <el-form-item label="" prop="weight">
            <el-input
              v-model="ruleForm.weight"
              @blur="calcTargetWeight"
              :maxLength="5"
            >
              <template v-slot:prepend
                ><span style="color: #ff0000">*</span> 体重</template
              >
              <template v-slot:append>kg</template>
            </el-input>
          </el-form-item>

          <el-form-item label="" prop="targetWeight">
            <el-input v-model="ruleForm.targetWeight" :disabled="true">
              <template v-slot:prepend
                ><span style="color: #ff0000">*</span> 目标体重</template
              >
              <template v-slot:append>kg</template>
            </el-input>
          </el-form-item>
          <el-form-item label="" prop="waist">
            <el-input v-model="ruleForm.waist" :maxLength="4">
              <template v-slot:prepend>腰围</template>
              <template v-slot:append>cm</template>
            </el-input>
          </el-form-item>
          <div name="1" class="mb10" v-show="isxshow">
            <el-form-item label="足背动脉搏动" prop="arteryPulsation">
              <el-radio-group v-model="ruleForm.arteryPulsation">
                <el-radio :value="'触及正常'"> 触及正常 </el-radio>
                <el-radio :value="'减弱-双侧'"> 减弱-双侧 </el-radio>
                <el-radio :value="'减弱-左侧'"> 减弱-左侧 </el-radio>
                <el-radio :value="'减弱-右侧'"> 减弱-右侧 </el-radio>
                <el-radio :value="'消失-双侧'"> 消失-双侧 </el-radio>
                <el-radio :value="'消失-左侧'"> 消失-左侧 </el-radio>
                <el-radio :value="'消失-右侧'"> 消失-右侧 </el-radio>
              </el-radio-group>
            </el-form-item>
          </div>

          <h4 id="sh">生活方式</h4>
          <el-form-item label="" prop="dailySmoking">
            <el-input v-model="ruleForm.dailySmoking" :maxLength="3">
              <template v-slot:prepend
                ><span style="color: #ff0000">*</span> 日吸烟量</template
              >
              <template v-slot:append>支</template>
            </el-input>
          </el-form-item>
          <el-form-item label="" prop="dailyDrink">
            <el-input v-model="ruleForm.dailyDrink" :maxLength="3">
              <template v-slot:prepend
                ><span style="color: #ff0000">*</span> 日饮酒量</template
              >
              <template v-slot:append>两</template>
            </el-input>
          </el-form-item>
          <el-form-item label="" prop="dailyExerciseFrequency">
            <el-input v-model="ruleForm.dailyExerciseFrequency" :maxLength="4">
              <template v-slot:prepend
                ><span style="color: #ff0000">*</span> 运动次数</template
              >
              <template v-slot:append>次/周</template>
            </el-input>
          </el-form-item>
          <el-form-item label="" prop="dailyExerciseTime">
            <el-input v-model="ruleForm.dailyExerciseTime" :maxLength="4">
              <template v-slot:prepend
                ><span style="color: #ff0000">*</span> 运动量</template
              >
              <template v-slot:append>分钟/次</template>
            </el-input>
          </el-form-item>
          <el-form-item label="" prop="stapleFood" v-show="isxshow">
            <el-input v-model="ruleForm.stapleFood" :maxLength="4">
              <template v-slot:prepend
                ><span style="color: #ff0000">*</span>主食量</template
              >
              <template v-slot:append>克/日</template>
            </el-input>
          </el-form-item>
          <el-form-item
            label="摄盐情况（咸淡）"
            prop="saltRelated"
            v-show="isgshow"
          >
            <el-radio-group v-model="ruleForm.saltRelated">
              <el-radio label="轻" value="轻"></el-radio>
              <el-radio label="中" value="中"></el-radio>
              <el-radio label="重" value="重"></el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="心理调整" prop="psychological">
            <el-radio-group v-model="ruleForm.psychological">
              <el-radio label="良好" value="良好"></el-radio>
              <el-radio label="一般" value="一般"></el-radio>
              <el-radio label="差" value="差"></el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="遵医行为" prop="complianceBehavior">
            <el-radio-group v-model="ruleForm.complianceBehavior">
              <el-radio label="良好" value="良好"></el-radio>
              <el-radio label="一般" value="一般"></el-radio>
              <el-radio label="差" value="差"></el-radio>
            </el-radio-group>
          </el-form-item>
          <h4 id="xc">下次随访目标</h4>
          <el-form-item label="" prop="targetSmoking">
            <el-input v-model="ruleForm.targetSmoking" :maxLength="3">
              <template v-slot:prepend
                ><span style="color: #ff0000">*</span> 日吸烟量</template
              >
              <template v-slot:append>支</template>
            </el-input>
          </el-form-item>
          <el-form-item label="" prop="targetDrink">
            <el-input v-model="ruleForm.targetDrink" :maxLength="3">
              <template v-slot:prepend
                ><span style="color: #ff0000">*</span> 日饮酒量</template
              >
              <template v-slot:append>两</template>
            </el-input>
          </el-form-item>
          <el-form-item label="" prop="targetExerciseFrequency">
            <el-input v-model="ruleForm.targetExerciseFrequency" :maxLength="4">
              <template v-slot:prepend
                ><span style="color: #ff0000">*</span> 运动次数</template
              >
              <template v-slot:append>次/周</template>
            </el-input>
          </el-form-item>
          <el-form-item label="" prop="targetExerciseTime">
            <el-input v-model="ruleForm.targetExerciseTime" :maxLength="4">
              <template v-slot:prepend
                ><span style="color: #ff0000">*</span> 运动量</template
              >
              <template v-slot:append>分钟/次</template>
            </el-input>
          </el-form-item>
          <el-form-item label="" prop="targetStapleFood" v-show="isxshow">
            <el-input v-model="ruleForm.targetStapleFood" :maxLength="4">
              <template v-slot:prepend
                ><span style="color: #ff0000">*</span>主食量</template
              >
              <template v-slot:append>克/日</template>
            </el-input>
          </el-form-item>
          <el-form-item
            label="摄盐情况（咸淡）"
            prop="targetRelated"
            v-show="isgshow"
          >
            <el-radio-group v-model="ruleForm.targetRelated">
              <el-radio label="轻" value="轻"></el-radio>
              <el-radio label="中" value="中"></el-radio>
              <el-radio label="重" value="重"></el-radio>
            </el-radio-group>
          </el-form-item>

          <h4>辅助检查</h4>
          <el-form-item label="" prop="glycosylatedHemoglobin">
            <el-input v-model="ruleForm.glycosylatedHemoglobin" :maxLength="4">
              <template v-slot:prepend>糖化血红蛋白</template>
              <template v-slot:append>%</template>
            </el-input>
          </el-form-item>
          <!-- <el-form-item label="检查日期" prop="inspectionDate">
            <el-date-picker
              :disabled="true"
              v-model="ruleForm.inspectionDate"
              type="date"
              value-format="YYYY-MM-DD"
              style="width: 100%"
            ></el-date-picker>
          </el-form-item> -->
          <div style="display: flex; width: 100%">
            <div class="timebox">检查日期</div>
            <el-form-item label="" prop="inspectionDate" style="width: 90%">
              <el-date-picker
                v-model="ruleForm.inspectionDate"
                :disabled-date="disableFutureDates"
                type="date"
                value-format="YYYY-MM-DD"
                style="width: 100%"
              ></el-date-picker>
            </el-form-item>
          </div>
          <h4>随访总结</h4>
          <el-form-item label="" prop="heartRate">
            <el-input
              v-model="ruleForm.heartRate"
              :maxLength="4"
              @input="debouncedCalcTargetHeartRate"
            >
              <template v-slot:prepend> 心率</template>
              <template v-slot:append>次/分</template>
            </el-input>
          </el-form-item>
          <el-form-item label="" prop="fastingBloodGlucose" v-show="isxshow">
            <el-input
              v-model="ruleForm.fastingBloodGlucose"
              :maxLength="4"
              @input="debounceFunction4"
            >
              <template v-slot:prepend>空腹血糖</template>
              <template v-slot:append>mmol/L</template>
            </el-input>
          </el-form-item>
          <el-form-item label="" prop="randomBloodGlucose" v-show="isxshow">
            <el-input
              v-model="ruleForm.randomBloodGlucose"
              :maxLength="4"
              @input="debounceFunction3"
            >
              <template v-slot:prepend>随机血糖</template>
              <template v-slot:append>mmol/L</template>
            </el-input>
          </el-form-item>
          <el-form-item label="" prop="bloodPressure">
            <el-input
              v-model="ruleForm.bloodPressure"
              :maxLength="7"
              @input="debounceFunction"
            >
              <template v-slot:prepend
                ><span style="color: #ff0000" v-if="getFollowWay">*</span>
                血压</template
              >
              <template v-slot:append>mmHg</template>
            </el-input>
          </el-form-item>
          <el-form-item
            label="高血压随访分类"
            prop="classFollowHypertension"
            v-show="isgshow"
          >
            <el-radio-group v-model="ruleForm.classFollowHypertension">
              <el-radio label="控制满意" value="控制满意"></el-radio>
              <el-radio label="控制不满意" value="控制不满意"></el-radio>
              <el-radio label="不良反应" value="不良反应"></el-radio>
              <el-radio label="并发症" value="并发症"></el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item
            label="糖尿病随访分类"
            prop="classFollowDiabetes"
            v-show="isxshow"
          >
            <el-radio-group v-model="ruleForm.classFollowDiabetes">
              <el-radio label="控制满意" value="控制满意"></el-radio>
              <el-radio label="控制不满意" value="控制不满意"></el-radio>
              <el-radio label="不良反应" value="不良反应"></el-radio>
              <el-radio label="并发症" value="并发症"></el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item
            label="低血糖反应"
            prop="hypoglycemicReactions"
            v-show="isxshow"
          >
            <el-radio-group v-model="ruleForm.hypoglycemicReactions">
              <el-radio label="无" value="无"></el-radio>
              <el-radio label="偶尔" value="偶尔"></el-radio>
              <el-radio label="频繁" value="频繁"></el-radio>
            </el-radio-group>
          </el-form-item>

          <el-form-item
            label=""
            class="border"
            prop="isreferral"
            style="margin-bottom: 20px"
          >
            <el-checkbox v-model="ruleForm.isreferral">转诊</el-checkbox>
          </el-form-item>
          <el-form-item
            v-show="ruleForm.isreferral"
            label=""
            prop="referralReason"
          >
            <el-input v-model="ruleForm.referralReason">
              <template v-slot:prepend>转诊原因</template>
            </el-input>
          </el-form-item>
          <el-form-item
            v-show="ruleForm.isreferral"
            label=""
            prop="referralInstitution"
          >
            <el-input v-model="ruleForm.referralInstitution">
              <template v-slot:prepend>机构及科别</template>
            </el-input>
          </el-form-item>

          <!-- <el-form-item label="" prop="status">
            <el-input v-model="ruleForm.status" placeholder="" :disabled="true">
              <template   v-slot:prepend>随访状态</template>
            </el-input>
          </el-form-item> -->
          <el-form-item
            label="高血压下次随访日期"
            prop="nextFollowTimeHypertension"
            v-if="dTobj !== '糖尿病'"
          >
            <el-date-picker
              v-model="ruleForm.nextFollowTimeHypertension"
              type="date"
              placeholder="选择日期"
              value-format="YYYY-MM-DD"
              :disabled-date="disableNextTiem"
              style="width: 100%"
            ></el-date-picker>
          </el-form-item>
          <el-form-item
            label="糖尿病下次随访时间"
            prop="nextFollowTimeDiabetes"
            v-if="dTobj !== '高血压'"
          >
            <el-date-picker
              v-model="ruleForm.nextFollowTimeDiabetes"
              type="date"
              placeholder="选择日期"
              value-format="YYYY-MM-DD"
             :disabled-date="disableNextTiem"
              style="width: 100%"
            ></el-date-picker>
          </el-form-item>
          <el-form-item label="备注" prop="remark">
            <el-input v-model="ruleForm.remark" type="textarea" placeholder="">
            </el-input>
          </el-form-item>
          <!-- <el-form-item
            label="高血压下次随访时间"
            prop="nextFollowTimeHypertension"
            v-if="dTobj == '高糖'"
          >
            <el-date-picker
              v-model="ruleForm.nextFollowTimeHypertension"
              type="date"
              placeholder="选择日期"
              value-format="YYYY-MM-DD"
              :picker-options="pickerOptions"
              style="width: 100%"
            ></el-date-picker>
          </el-form-item>
          <el-form-item
            label="糖尿病下次随访时间"
            prop="nextFollowTimeDiabetes"
            v-if="dTobj == '高糖'"
          >
            <el-date-picker
              v-model="ruleForm.nextFollowTimeDiabetes"
              type="date"
              placeholder="选择日期"
              value-format="YYYY-MM-DD"
              :picker-options="pickerOptions"
              style="width: 100%"
            ></el-date-picker>
          </el-form-item> -->
          <!-- <el-form-item label="" prop="followTimeOut">
            <el-input v-model="ruleForm.followTimeOut" placeholder="" :disabled="true">
              <template   v-slot:prepend>随访超时</template>
            </el-input>
          </el-form-item> -->
        </el-form>
        <h4>用药情况</h4>
        <el-row :gutter="20" style="border-bottom: 1px solid #c1c1c1">
          <el-col :span="18">
            <h4>药品</h4>
          </el-col>
          <el-col :span="3" style="text-align: right"
            ><el-button type="primary" class="mt20" @click="addDrug"
              >新增</el-button
            ></el-col
          >
        </el-row>
        <el-form
          ref="drugValidateForm"
          :model="drugValidateForm"
          label-width="0"
          class="demo-dynamic"
        >
          <el-row
            v-for="(drug, index) in drugValidateForm.drugs"
            :key="drug.key"
            :gutter="20"
            class="border"
          >
            <el-col :span="3" style="text-align: left; padding-top: 10px"
              >药品</el-col
            >
            <el-col :span="18" style="padding-top: 10px">
              <el-form-item
                label=""
                :prop="'drugs.' + index + '.药品名称'"
                :rules="{
                  required: true,
                  message: '药名不能为空',
                  trigger: 'blur',
                }"
              >
                <el-input v-model="drug.药品名称">
                  <template v-slot:prepend>药品名称</template>
                </el-input>
              </el-form-item>
              <el-row>
                <el-col :span="12">
                  <el-form-item label="" :prop="'drugs.' + index + '.用药类型'">
                    <el-radio-group v-model="drug.用药类型">
                      <el-radio label="外院" value="外院"></el-radio>
                      <el-radio label="自购" value="自购"></el-radio>
                      <el-radio label="本院" value="本院"></el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item
                    label=""
                    :prop="'drugs.' + index + '.天'"
                    :rules="{
                      required: true,
                      message: '天不能为空',
                      trigger: 'blur',
                    }"
                  >
                    <el-input v-model="drug.天">
                      <template v-slot:prepend>用量</template>
                      <template v-slot:append>天</template>
                    </el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    label=""
                    :prop="'drugs.' + index + '.次'"
                    :rules="{
                      required: true,
                      message: '次数不能为空',
                      trigger: 'blur',
                    }"
                  >
                    <el-input v-model="drug.次">
                      <template v-slot:append>次</template>
                    </el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item
                    label=""
                    :prop="'drugs.' + index + '.用量'"
                    :rules="{
                      required: true,
                      message: '用量不能为空',
                      trigger: 'blur',
                    }"
                  >
                    <el-input v-model="drug.用量">
                      <template v-slot:prepend>每次</template>
                      <template v-slot:append>/</template>
                    </el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    label=""
                    :prop="'drugs.' + index + '.单位'"
                    :rules="{
                      required: true,
                      message: '单位不能为空',
                      trigger: 'blur',
                    }"
                  >
                    <el-input v-model="drug.单位">
                      <template v-slot:append>(单位)</template>
                    </el-input>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-col>
            <el-col :span="3" style="text-align: right; padding-top: 10px"
              ><el-button
                style="margin-top: 3px"
                @click.prevent="removeDrug(drug)"
                >删除</el-button
              ></el-col
            >
          </el-row>
        </el-form>
        <el-row :gutter="20" style="border-bottom: 1px solid #c1c1c1">
          <el-col :span="18">
            <h4>胰岛素</h4>
          </el-col>
          <el-col :span="3" style="text-align: right"
            ><el-button type="primary" class="mt20" @click="addInsulin"
              >新增</el-button
            ></el-col
          >
        </el-row>
        <el-form
          ref="insulinValidateForm"
          :model="insulinValidateForm"
          label-width="0"
          class="demo-dynamic"
        >
          <el-row
            v-for="(insulin, index) in insulinValidateForm.insulins"
            :key="insulin.key"
            :gutter="20"
          >
            <el-col :span="3" style="text-align: left; padding-top: 10px"
              >胰岛素</el-col
            >
            <el-col :span="18" style="padding-top: 10px">
              <el-form-item
                label=""
                :prop="'insulins.' + index + '.药品名称'"
                :rules="{
                  required: true,
                  message: '药名不能为空',
                  trigger: 'blur',
                }"
              >
                <el-input v-model="insulin.药品名称">
                  <template v-slot:prepend>药品名称</template>
                </el-input>
              </el-form-item>
              <el-row>
                <el-col :span="12">
                  <el-form-item
                    label=""
                    :prop="'insulins.' + index + '.用药类型'"
                  >
                    <el-radio-group v-model="insulin.用药类型">
                      <el-radio label="外院" value="外院"></el-radio>
                      <el-radio label="自购" value="自购"></el-radio>
                      <el-radio label="本院" value="本院"></el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-form-item
                    label=""
                    :prop="'insulins.' + index + '.用法'"
                    :rules="{
                      required: true,
                      message: '天不能为空',
                      trigger: 'blur',
                    }"
                  >
                    <el-input v-model="insulin.用法">
                      <template v-slot:prepend>用法</template>
                      <!-- <template v-slot:append>天</template> -->
                    </el-input>
                  </el-form-item>
                </el-col>
                <!-- <el-col :span="12">
                  <el-form-item
                    label=""
                    :prop="'insulins.' + index + '.次'"
                    :rules="{
                      required: true,
                      message: '次数不能为空',
                      trigger: 'blur',
                    }"
                  >
                    <el-input v-model="insulin.次">
                      <template v-slot:append>次</template>
                    </el-input>
                  </el-form-item>
                </el-col> -->
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-form-item
                    label=""
                    :prop="'insulins.' + index + '.用量'"
                    :rules="{
                      required: true,
                      message: '用量不能为空',
                      trigger: 'blur',
                    }"
                  >
                    <el-input v-model="insulin.用量">
                      <template v-slot:prepend>用量</template>
                      <!-- <template v-slot:append>/</template> -->
                    </el-input>
                  </el-form-item>
                </el-col>
                <!-- <el-col :span="12">
                  <el-form-item
                    label=""
                    :prop="'insulins.' + index + '.单位'"
                    :rules="{
                      required: true,
                      message: '单位不能为空',
                      trigger: 'blur',
                    }"
                  >
                    <el-input v-model="insulin.单位">
                      <template v-slot:append>(单位)</template>
                    </el-input>
                  </el-form-item>
                </el-col> -->
              </el-row>
            </el-col>
            <el-col :span="3" style="text-align: right; padding-top: 10px"
              ><el-button
                style="margin-top: 3px"
                @click.prevent="removeInsulin(insulin)"
                >删除</el-button
              ></el-col
            >
          </el-row>
        </el-form>
      </div>
      <span slot="footer" class="dialog_footer">
        <el-button @click="clickChange">取 消</el-button>
        <el-button type="primary" @click="saveRecord()">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { ElMessage } from "element-plus";
import http from "@/utils/request";
// import  debounce  from "lodash";
import { debounce } from "lodash";
import { getUserName } from "@/utils/common";
const disableFutureDates = (time) => time > new Date();
const disableNextDates = (time) => time < new Date();
export default {
  name: "RecordPage",
  components: {},
  data() {
    const validateNum = (rule, value, callback) => {
      if (value) {
        if (/[^\d.]/g.test(value)) {
          callback(new Error("只能输入数字"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    const validateNumW = (rule, value, callback) => {
      if (value != "") {
        if (/[\W]/g.test(value)) {
          callback(new Error("只能输入数字或字母"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    const validatorIdCard = (rule, value, callback) => {
      const aCity = {
        11: "北京",
        12: "天津",
        13: "河北",
        14: "山西",
        15: "内蒙古",
        21: "辽宁",
        22: "吉林",
        23: "黑龙江",
        31: "上海",
        32: "江苏",
        33: "浙江",
        34: "安徽",
        35: "福建",
        36: "江西",
        37: "山东",
        41: "河南",
        42: "湖北",
        43: "湖南",
        44: "广东",
        45: "广西",
        46: "海南",
        50: "重庆",
        51: "四川",
        52: "贵州",
        53: "云南",
        54: "西藏",
        61: "陕西",
        62: "甘肃",
        63: "青海",
        64: "宁夏",
        65: "新疆",
        71: "台湾",
        81: "香港",
        82: "澳门",
        91: "国外",
      };
      // 验证长度
      if (!/^\d{17}(\d|x)$/i.test(value)) {
        callback(new Error("您输入的身份证号长度或格式错误"));
        return;
      }
      // 验证前两位是否为省份代码
      value = value.replace(/x$/i, "a");
      if (aCity[parseInt(value.substr(0, 2))] == null) {
        callback(new Error("您输入的身份证号长度或格式错误"));
        return;
      }
      // 身份证上的出生年月校验
      const sBirthday =
        value.substr(6, 4) +
        "-" +
        Number(value.substr(10, 2)) +
        "-" +
        Number(value.substr(12, 2));
      const d = new Date(sBirthday.replace(/-/g, "/"));
      if (
        sBirthday !==
        d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate()
      ) {
        callback(new Error("您输入的身份证号不合法，请输入正确的身份证号"));
        return;
      }
      // 身份证校验位判断
      let iSum = 0;
      for (let i = 17; i >= 0; i--) {
        iSum += (Math.pow(2, i) % 11) * parseInt(value.charAt(17 - i), 11);
      }
      if (iSum % 11 !== 1) {
        callback(new Error("您输入的身份证号不合法，请输入正确的身份证号"));
        return;
      }
      callback();
    };
    const validateNumR = (rule, value, callback) => {
      if (value !== "") {
        if (/[^\d.]/g.test(value)) {
          callback(new Error("只能输入数字"));
        } else {
          callback();
        }
      } else {
        callback(new Error("此项需填写"));
      }
    };
    const validateNumR1 = (rule, value, callback) => {
      if (value) {
        if (/[^\d.]/g.test(value)) {
          console.log(value);

          callback(new Error("只能输入数字"));
        } else if (value < 40 || value > 220) {
          callback(new Error("请输入正确的范围"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    const validateNum300 = (rule, value, callback) => {
      if (value) {
        if (/[^\d.]/g.test(value)) {
          callback(new Error("只能输入数字"));
        } else if (value < 0 || value > 300) {
          callback(new Error("请输入正确的范围"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    const validateNum30 = (rule, value, callback) => {
      if (value) {
        if (/[^\d.]/g.test(value)) {
          callback(new Error("只能输入数字"));
        } else if (value < 0 || value > 30) {
          callback(new Error("请输入正确的范围"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    const validateNum20 = (rule, value, callback) => {
      if (value !== "") {
        if (/[^\d.]/g.test(value)) {
          callback(new Error("只能输入数字"));
        } else if (value < 0 || value > 20) {
          callback(new Error("请输入正确的范围"));
        } else {
          callback();
        }
      } else {
        callback(new Error("此项需填写"));
      }
    };
    const validateNum3000 = (rule, value, callback) => {
      if (value) {
        if (/[^\d.]/g.test(value)) {
          callback(new Error("只能输入数字"));
        } else if (value < 100 || value > 3000) {
          callback(new Error("请输入正确的范围"));
        } else {
          callback();
        }
      } else {
        if (this.ruleForm.issymptomsDiabetes) {
          callback(new Error("请输入日常主食量"));
        } else {
          callback();
        }
      }
    };
    const validateNum3001 = (rule, value, callback) => {
      if (value) {
        if (/[^\d.]/g.test(value)) {
          callback(new Error("只能输入数字"));
        } else if (value < 100 || value > 3000) {
          callback(new Error("请输入正确的范围"));
        } else {
          callback();
        }
      } else {
        if (this.ruleForm.issymptomsDiabetes) {
          callback(new Error("请输入目标主食量"));
        } else {
          callback();
        }
      }
    };
    const validateNum100 = (rule, value, callback) => {
      if (value !== "") {
        if (/[^\d.]/g.test(value)) {
          callback(new Error("只能输入数字"));
        } else if (value < 0 || value > 100) {
          callback(new Error("请输入正确的范围"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    const validateNum101 = (rule, value, callback) => {
      //@ts-ignore
      const dailySmoking = Number(this.ruleForm.dailySmoking);
      if (value !== "") {
        if (/[^\d.]/g.test(value)) {
          callback(new Error("只能输入数字"));
        } else if (value < 0 || value > 100) {
          callback(new Error("请输入正确的范围"));
          //@ts-ignore
        } else if (value > dailySmoking) {
          callback(new Error("目标吸烟量不能大于日常吸烟量"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    const validateNum50 = (rule, value, callback) => {
      if (value !== "") {
        if (/[^\d.]/g.test(value)) {
          callback(new Error("只能输入数字"));
        } else if (value < 0 || value > 50) {
          callback(new Error("请输入正确的范围"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    const validateNum51 = (rule, value, callback) => {
      if (value !== "") {
        //@ts-ignore
        const dailyDrink = Number(this.ruleForm.dailyDrink);
        if (/[^\d.]/g.test(value)) {
          callback(new Error("只能输入数字"));
        } else if (value < 0 || value > 50) {
          callback(new Error("请输入正确的范围"));
          //@ts-ignore
        } else if (value > dailyDrink) {
          callback(new Error("目标饮酒量不能大于日常饮酒量"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    const validateNum501 = (rule, value, callback) => {
      if (value !== "") {
        if (/[^\d.]/g.test(value)) {
          callback(new Error("只能输入数字"));
        } else if (value < 3.39 || value > 28.67) {
          callback(new Error("请输入正确的范围"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    const validTemperature = (rule, value, callback) => {
      if (value !== "") {
        if (/[^\d.]/g.test(value)) {
          callback(new Error("只能输入数字"));
        } else if (value < 34 || value > 43) {
          callback(new Error("请输入正确的体温"));
        } else {
          callback();
        }
      } else {
        callback(new Error("请填写体温"));
      }
    };
    const validBloodPressure = (rule, value, callback) => {
      if (!value) {
        if (this.getFollowWay) {
          callback(new Error("请输入血压"));
        } else {
          callback();
        }
      } else {
        const bloodPressure_l = value.split("/")[0];
        const bloodPressure_h = value.split("/")[1];
        const regex = /^[1-9]{1}[0-9]{0,2}\/[1-9]{1}[0-9]{0,2}$|^0\/0$/; // 格式：1-3位数字/1-3位数字 或 0/0
        if (!regex.test(value)) {
          callback(
            new Error("血压格式不正确，应为收缩压/舒张压")
          );
          return;
        }
        if (value == "0/0" && this.getFollowWay) {
          callback(new Error("请输入血压"));
        } else if (bloodPressure_h - 0 > bloodPressure_l - 0) {
          callback(new Error("舒张压不能大于收缩压"));
        } else {
          callback();
        }
      }
    };
    const gxyture = (rule, value, callback) => {
      if (value == "" && this.ruleForm.issymptom) {
        callback(new Error("请选择摄盐情况"));
      } else {
        callback();
      }
    };
    const tnbture = (rule, value, callback) => {
      if (!this.ruleForm.arteryPulsation && this.ruleForm.issymptomsDiabetes) {
        callback(new Error("请选择足背动脉情况"));
      } else {
        callback();
      }
    };

    const validPulseRate = (rule, value, callback) => {
      if (value !== "") {
        if (/[^\d.]/g.test(value)) {
          callback(new Error("只能输入数字"));
        } else if (value > 300) {
          callback(new Error("请输入正常范围"));
        } else {
          callback();
        }
      } else {
        callback(new Error("此项需填写"));
      }
    };
    return {
      dTobj1: "",
      popoverVisible: true,
      isPopOpen: false,
      concurrency: "",
      collecting: "",
      updating: "",
      columns: [
        // { label: '姓名',visible: true },
        // { label: '性别',visible: true },
        // { label: '证件号码',visible: true },
        // { label: '随访日期',visible: true },
        // { label: '随访类型',visible: true },
        // { label: '随访方式',visible: true },
        { label: "采集状态", visible: true },
        { label: "回填状态", visible: true },
        { label: "录入人", visible: true },
        { label: "随访医生", visible: true },
        // { label: "家庭医生", visible: true },
        { label: "病种", visible: true },
        { label: "高血压症状", visible: true },
        { label: "糖尿病症状", visible: true },
        { label: "血压", visible: true },
        { label: "心率", visible: true },
        { label: "身高", visible: true },
        { label: "体重", visible: true },
        { label: "目标体重", visible: true },
        { label: "体质指数", visible: true },
        { label: "足背动脉搏动", visible: true },
        { label: "腰围", visible: true },
        { label: "日常吸烟量", visible: true },
        { label: "目标吸烟量", visible: true },
        { label: "日常饮酒量", visible: true },
        { label: "目标饮酒量", visible: true },
        { label: "运动量", visible: true },
        { label: "目标运动量", visible: true },
        { label: "摄盐情况", visible: true },
        { label: "目标摄盐量", visible: true },
        { label: "心理调整", visible: true },
        { label: "主食量", visible: true },
        { label: "目标主食量", visible: true },
        { label: "遵医行为", visible: true },
        { label: "空腹血糖", visible: true },
        { label: "糖化血红蛋白", visible: true },
        { label: "检查日期", visible: true },
        { label: "其他(随机血糖)", visible: true },
        { label: "高血压服药依从性", visible: true },
        { label: "糖尿病服药依从性", visible: true },
        { label: "低血糖反应", visible: true },
        { label: "药物不良反应", visible: true },
        { label: "高血压随访分类", visible: true },
        { label: "糖尿病随访分类", visible: true },
        { label: "用药情况", visible: true },
        { label: "转诊原因", visible: true },
        { label: "机构及科别", visible: true },
        { label: "创建日期", visible: true },
        { label: "诊疗信息导入日期", visible: true },
        { label: "高血压下次随访日期", visible: true },
        { label: "糖尿病下次随访日期", visible: true },
        { label: "胰岛素", visible: true },
      ],
      tempVisibility: [],
      data: [
        { name: "John", age: 30, gender: "Male" },
        { name: "Jane", age: 25, gender: "Female" },
        { name: "Smith", age: 40, gender: "Male" },
      ],
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() < Date.now();
        },
      },
      errlenght: 0,
      iszz: {
        iszz1: false,
        iszz2: false,
        iszz3: false,
        iszz4: false,
        iszz5: false,
        iszz6: false,
      },
      //全选状态
      checkedAll: false,
      selectionCount: 0,
      isxshow: true,
      isgshow: true,
      dialogDescVisible: false,
      dialogUploadVisible: false,
      multipleSelection: [],
      ruleForm: {
        followTime: "",
        name: "",
        phoneNumber: "",
        cardNumber: "",
        cardType: "",
        birthday: "",
        gender: "",
        contactsName: "",
        contactsPhoneNumber: "",
        allergy: "",
        address: "",
        domicileAddress: "",
        followDoctor: "",
        followType: "",
        followTypeOther: "",
        followWay: "",
        inputPerson: "",
        responsibleDoctor: "",
        issymptom: false,
        symptomHypertension: [],
        symptomOther: "",
        issymptomsDiabetes: false,
        symptomsDiabetes: [],
        symptomsDiabetesOther: "",
        temperature: "",
        // pulseRate: '',
        heartRate: "",
        weight: "",
        targetWeight: "",
        height: "",
        arteryPulsation: "触及正常",
        waist: "",
        fastingBloodGlucose: "",
        randomBloodGlucose: "",
        glycosylatedHemoglobin: "",
        inspectionDate: "",
        bloodPressure: "",
        dailyExerciseFrequency: "",
        dailyExerciseTime: "",
        saltRelated: "轻",
        // stapleFoodName: '',
        stapleFood: "",
        dailySmoking: "",
        dailyDrink: "",
        psychological: "",
        complianceBehavior: "",
        targetExerciseFrequency: "",
        targetExerciseTime: "",
        targetRelated: "轻",
        targetStapleFood: "",
        targetSmoking: "",
        targetDrink: "",
        classFollowHypertension: "",
        classFollowDiabetes: "",
        hypoglycemicReactions: "",
        createTime: "",
        inspectionDate: "",
        // followTimeOut: '',
        isreferral: false,
        referralReason: "",
        referralInstitution: "",
        nextFollowTime: "",
        nextFollowTimeHypertension: "",
        nextFollowTimeDiabetes: "",
        remark: "",
        diseaseType: "",
        // followDoctor: "",
      },
      rules: {
        temperature: [
          { required: true, validator: validTemperature, trigger: "blur" },
        ],
        bloodPressure: [
          { required: false, validator: validBloodPressure, trigger: "blur" },
        ],
        // pulseRate: [
        //   { required: true, validator: validPulseRate, trigger: 'blur' }
        // ],
        heartRate: [{ validator: validateNumR1, trigger: "blur" }],
        weight: [
          { required: true, validator: validPulseRate, trigger: "blur" },
        ],
        targetWeight: [{ validator: validPulseRate, trigger: "blur" }],
        height: [
          { required: true, validator: validPulseRate, trigger: "blur" },
        ],
        waist: [{ validator: validateNum300, trigger: "blur" }],
        fastingBloodGlucose: [{ validator: validateNum30, trigger: "blur" }],
        randomBloodGlucose: [{ validator: validateNum30, trigger: "blur" }],
        glycosylatedHemoglobin: [
          { validator: validateNum501, trigger: "change" },
        ],
        dailyExerciseFrequency: [
          { required: true, validator: validateNum20, trigger: "blur" },
        ],
        dailyExerciseTime: [
          { required: true, validator: validateNumR, trigger: "blur" },
        ],
        arteryPulsation: [
          { required: true, validator: tnbture, trigger: "change" },
        ],
        saltRelated: [
          { required: true, validator: gxyture, trigger: "change" },
        ],
        stapleFood: [{ validator: validateNum3000, trigger: "blur" }],
        targetStapleFood: [{ validator: validateNum3001, trigger: "blur" }],
        dailySmoking: [
          { required: true, validator: validateNum100, trigger: "blur" },
        ],
        dailyDrink: [
          { required: true, validator: validateNum50, trigger: "blur" },
        ],
        targetExerciseFrequency: [
          { validator: validateNum20, trigger: "blur" },
        ],
        targetExerciseTime: [{ validator: validateNumR, trigger: "blur" }],
        targetSmoking: [{ validator: validateNum101, trigger: "blur" }],
        targetDrink: [{ validator: validateNum51, trigger: "blur" }],
        psychological: [
          { required: true, message: "至少选一个", trigger: "change" },
        ],
        targetRelated: [
          { required: true, validator: gxyture, trigger: "change" },
        ],
        complianceBehavior: [
          { required: true, message: "至少选一个", trigger: "change" },
        ],
        // classFollowHypertension: [
        //   { required: true, message: '至少选一个', trigger: 'change' }
        // ],
        // classFollowDiabetes: [
        //   { required: true, message: '至少选一个', trigger: 'change' }
        // ],
        // hypoglycemicReactions: [
        //   { required: true, message: '至少选一个', trigger: 'change' }
        // ],
      },
      drugValidateForm: {
        drugs: [],
      },
      insulinValidateForm: {
        insulins: [],
      },
      formInline: {
        name: "",
        cardNumber: "",
        phoneNumber: "",
        gender: "",
        inputPerson: "",
        // status: '',
        // followTimeOut: '',
        followType: "",
        followWay: "",
        followTime: "",
        nextFollowTimeHypertension: "",
        nextFollowTimeDiabetes: "",
        createTime: "",
        inspectionDate: "",
        qualityType: "",
        responsibleDoctor: "",
        diseaseType: "",
        classFollowHypertension: "",
        classFollowDiabetes: "",
        collectStatus: "",
        backFillingStatus: "",
        startTime: "",
        endTime: "",
        followBeginTime: "",
        followEndTime: "",
        nextFollowBeginTime: "",
        nextFollowEndTime: "",
        startTime: "",
        endTime: "",
      },
      formInlineRules: {
        phoneNumber: [{ validator: validateNum, trigger: "change" }],
        cardNumber: [{ validator: validatorIdCard, trigger: "change" }],
      },
      people: null,
      tableData: [],
      tableLoading: false,
      currentPage: 1,
      size: 10,
      fileList: [],
      total: 0,
      showFollowTypeOther: false,
      showSymptomOther: false,
      showSymptomsDiabetesOther: false,
      fullscreenLoading: false,
      dTobj: "",
    };
  },
  created() {
    this.getRecord();
    this.searchQuest();
    this.tempVisibility = this.columns.map((col) => col.visible);
    this.debouncedCalcTargetHeartRate = debounce(this.calcTargetHeartRate, 500);
  },
  mounted() {},
  beforeDestroy() {},
  methods: {
    disableNextTiem(time) {
      if(this.dialogDescVisible){
        const followTime = new Date(this.ruleForm.followTime); // 转换为 Date 对象
      const maxDate = new Date(followTime);
      maxDate.setMonth(followTime.getMonth() + 4); // 计算 followTime 后 4 个月

      // 转换为 UTC 时间（避免时区差异影响）
      const timeInMs = time.getTime();
      const followTimeInMs = followTime.getTime();
      const maxDateInMs = maxDate.getTime();
      // 判断是否禁用日期
      return timeInMs < followTimeInMs || timeInMs > maxDateInMs;
      }
     
    },
    calculateFutureDate(days) {
      const currentDate = new Date(this.ruleForm.followTime);
      const futureDate = new Date(
        currentDate.getTime() + days * 24 * 60 * 60 * 1000
      );

      if (days == 3) {
        currentDate.setMonth(currentDate.getMonth() + days);
        console.log(currentDate.toISOString().split("T")[0]);
        return currentDate.toISOString().split("T")[0]; // 返回形如 'YYYY-MM-DD' 的字符串
      } else {
        console.log(futureDate.toISOString().split("T")[0]);
        return futureDate.toISOString().split("T")[0]; // 返回形如'YYYY-MM-DD'的字符串
      }
    },
    //心率输入
    calcTargetHeartRate(e) {
      if (e > 100) {
        this.iszz.iszz5 = true;
        this.$message({
          type: "error",
          message: "心动过速，需紧急转诊",
        });
      } else {
        this.iszz.iszz5 = false;
      }
    },
    //队列显示方法
    searchQuest() {
      http.get("/followRecord/searchQuest").then((res) => {
        if (res.code == 200) {
          this.concurrency = res.data.concurrency;
          this.collecting = res.data.collecting;
          this.updating = res.data.updating;
        }
      });
    },
    showPopover() {
      this.popoverVisible = !this.popoverVisible;
    },
    togglePopover() {
      this.isPopOpen = !this.isPopOpen;
    },
    handlePopoverClose() {
      this.tempVisibility = this.columns.map((col) => col.visible);
      // this.popoverVisible = false;
    },
    //控制字段
    applyColumnVisibility() {
      this.columns.forEach((col, index) => {
        col.visible = this.tempVisibility[index]; // 更新真正的列可见性
      });
      this.popoverVisible = false;
    },
    //重置字段
    applyReset() {
      this.columns.forEach((col) => (col.visible = true));
      this.tempVisibility = this.columns.map((col) => col.visible); // 更新临时状态
      this.popoverVisible = false;
      console.log(this.popoverVisible);
    },
    //字段显示方法
    isColumnVisible(label) {
      const column = this.columns.find((col) => col.label === label);
      // console.log(column);
      return column ? column.visible : false;
    },
    disableFutureDates,
    disableNextDates,
    checkSelectable() {
      return this.checkedAll != true;
    },
    checkedAllChange() {
      if (this.checkedAll == true) {
        this.selectionCount = this.tableData.length;
        console.log(this.selectionCount);

        this.tableData.forEach((row) => {
          this.$refs.multipleTableRef.toggleRowSelection(row, true);
        });
      } else {
        this.selectionCount = 0;
        this.$refs.multipleTableRef.clearSelection();
      }
    },
    // 
    debounceFunction: debounce(function () {
      const bloodPressure_l = this.ruleForm.bloodPressure.split("/")[0];
      const bloodPressure_h = this.ruleForm.bloodPressure.split("/")[1];
       let show =false;
      if (this.age >= 65) {
        if (bloodPressure_l&&bloodPressure_l >= 150 && bloodPressure_l < 180) {
          // this.iszz.iszz1=true
          this.$message({
            type: "error",
            message: "血压过高，请及时转诊",
          });
          this.ruleForm.classFollowHypertension = "控制不满意";
          show=true;
        }else{
          show=false;
          this.ruleForm.classFollowHypertension = "控制满意";
        }
      } else if (this.age < 65) {
        if (bloodPressure_l&&bloodPressure_l >= 140 && bloodPressure_l < 180) {
          // this.iszz.iszz1=true
          this.$message({
            type: "error",
            message: "血压过高，请及时转诊",
          });
          this.ruleForm.classFollowHypertension = "控制不满意";
          show=true;
        }else{
          show=false;
          this.ruleForm.classFollowHypertension = "控制满意";
        }
      }
      //  else {
      //   this.iszz.iszz1 = false;
      //   // this.ruleForm4.classFollowHypertension = ["控制满意"];
      //   this.ruleForm.classFollowHypertension = "控制满意";
      //   console.log('1');
        
      // }
      if (bloodPressure_l&&bloodPressure_l >= 180) {
        this.iszz.iszz1 = true;
        this.$message({
          type: "error",
          message: "血压过高，需紧急转诊",
        });
        this.ruleForm.classFollowHypertension = "控制不满意";
        show=true;
      } else {
        this.iszz.iszz1 = false;
        // this.ruleForm4.classFollowHypertension = ["控制满意"];
        if(show){
        this.ruleForm.classFollowHypertension = "控制不满意"
        }else{
          this.ruleForm.classFollowHypertension = "控制满意";
        }
       
        console.log('2');
      }
      if (bloodPressure_h&&bloodPressure_h >= 110) {
        this.iszz.iszz2 = true;
        this.$message({
          type: "error",
          message: "血压过高，需紧急转诊",
        });
        this.ruleForm.classFollowHypertension = "控制不满意";
        show=true;
      } else if (this.age >= 65) {
        if (bloodPressure_h&&bloodPressure_h >= 90 && bloodPressure_h < 110) {
          // this.iszz.iszz2=true

          this.$message({
            type: "error",
            message: "血压过高，请及时转诊",
          });
          this.ruleForm.classFollowHypertension = "控制不满意";
        } else {
          this.iszz.iszz2 = false;
          // this.ruleForm4.classFollowHypertension = ["控制满意"];
          this.ruleForm4.classFollowHypertension = "控制满意";
          show=false;
        }
      } else if (this.age < 65) {
        if (bloodPressure_h&&bloodPressure_h >= 90 && bloodPressure_h < 110) {
          // this.iszz.iszz2=true
          this.$message({
            type: "error",
            message: "血压过高，请及时转诊",
          });
          this.ruleForm.classFollowHypertension = "控制不满意";
          show=true;
        } else {
          this.iszz.iszz2 = false;
          // this.ruleForm4.classFollowHypertension = ["控制满意"];
          if(show){
            this.ruleForm.classFollowHypertension = "控制不满意";
          }else{
            this.ruleForm.classFollowHypertension = "控制满意";
            show=true;
          }
          
          console.log('3');
        }
      } else {
        this.iszz.iszz2 = false;
        // this.ruleForm4.classFollowHypertension = ["控制满意"];
        this.ruleForm.classFollowHypertension = "控制满意";
        
      }

      if (bloodPressure_h&&bloodPressure_h >= 110 || bloodPressure_l >= 180) {
        this.ruleForm.classFollowDiabetes = "控制不满意";
        this.iszz.iszz2 = true;
      } else {
        if(show){
          this.ruleForm.classFollowDiabetes = "控制不满意";
        }else{
          this.ruleForm.classFollowDiabetes = "控制满意";
        }
        this.iszz.iszz2 = false;
      }
    }, 1000),
    // 随机血糖
    debounceFunction3: debounce(function () {
      if (this.ruleForm.randomBloodGlucose != "") {
        if (this.ruleForm.randomBloodGlucose >= 16.7) {
          this.iszz.iszz3 = true;
          this.$message({
            type: "error",
            message: "血糖过高，需紧急转诊",
          });
        } else if (this.ruleForm.randomBloodGlucose <= 3.9) {
          this.iszz.iszz3 = true;
          this.$message({
            type: "error",
            message: "血糖过低，需紧急转诊",
          });
        } else if (
          this.ruleForm.randomBloodGlucose >= 10 &&
          this.ruleForm.randomBloodGlucose < 16.7
        ) {
          // this.iszz.iszz3=true
          this.$message({
            type: "error",
            message: "血糖过高，请及时转诊",
          });
        } else {
          this.iszz.iszz3 = false;
          this.ruleForm.classFollowDiabetes = "控制满意";
        }
      } else {
        this.iszz.iszz3 = false;
        this.ruleForm.classFollowDiabetes = "控制满意";
      }
    }, 500),
    //空腹血糖
    debounceFunction4: debounce(function () {
      if (this.ruleForm.fastingBloodGlucose != "") {
        if (this.ruleForm.fastingBloodGlucose <= 3.9) {
          this.iszz.iszz4 = true;
          this.ruleForm.classFollowDiabetes = "控制不满意";
          this.$message({
            type: "error",
            message: "血糖过低，需紧急转诊",
          });
        } else if (
          this.ruleForm.fastingBloodGlucose >= 7.0 &&
          this.ruleForm.fastingBloodGlucose < 16.7
        ) {
          // this.iszz.iszz4=true
          this.ruleForm.classFollowDiabetes = "控制不满意";
          this.$message({
            type: "error",
            message: "血糖过高，请及时转诊",
          });
        } else if (this.ruleForm.fastingBloodGlucose >= 16.7) {
          this.iszz.iszz4 = true;
          this.ruleForm.classFollowDiabetes = "控制不满意";
          this.$message({
            type: "error",
            message: "血糖过高，需紧急转诊",
          });
        } else {
          this.iszz.iszz4 = false;
          this.ruleForm.classFollowDiabetes = "控制满意";
        }
      } else {
        this.iszz.iszz3 = false;
        this.ruleForm.classFollowDiabetes = "控制满意";
      }
    }, 500),
    clickChange() {
      this.dialogDescVisible = false;
      // this.getRecord()
    },
    syChange3(value) {
      this.ruleForm.arteryPulsation = ["触及正常"];
    },
    syChange2(value) {
      this.ruleForm.arteryPulsation = this.ruleForm.arteryPulsation.filter(
        (item) => item !== "触及正常"
      );
    },
    // getDiseaseType(row) {
    //  row.diseaseType
    // },
    getStatus(row, field) {
      if (row) {
        if (row[field + "Status"]) {
          const obj = JSON.parse(row[field + "Status"]);
          switch (obj.status) {
            case "错误类":
              obj.type = 2;
              break;
            case "告警类":
              obj.type = 1;
              break;
            default:
              obj.type = "";
          }
          return obj;
        } else {
          return { status: "正常", desc: "正常", type: "" };
        }
      }
      return { status: "正常", desc: "正常", type: "" };
    },
    getDrug(row) {
      let arr = [];
      if (row && row !== "无") {
        arr = JSON.parse(row);
      }
      const str = [];
      arr.length &&
        arr.forEach((v) => {
          str.push(
            "药品名称：" +
              v.药品名称 +
              " 用量：" +
              v.天 +
              "天" +
              v.次 +
              "次" +
              " 每次：" +
              v.用量 +
              v.单位
          );
        });
      return str.join(";");
    },
    getDrug2(row) {
      let arr = [];
      if (row && row !== "无") {
        arr = JSON.parse(row);
      }
      const str = [];
      arr.length &&
        arr.forEach((v) => {
          str.push(
            "药品名称：" +
              v.药品名称 +
              " 用法：" +
              v.用法 +
              // "天" +
              // v.次 +
              // "次" +
              " 用量：" +
              v.用量
            //  +
            // v.单位
          );
        });
      return str.join(";");
    },
    calcTargetWeight() {
      if (this.ruleForm.weight && this.ruleForm.height) {
        const bmi = (
          (this.ruleForm.weight /
            (this.ruleForm.height * this.ruleForm.height)) *
          10000
        ).toFixed(2);
        if (bmi >= 24) {
          this.ruleForm.targetWeight =
            Math.round(this.ruleForm.weight * 9.5) / 10;
        } else if (bmi < 18.5) {
          this.ruleForm.targetWeight =
            Math.round(this.ruleForm.weight * 10.5) / 10;
        } else {
          this.ruleForm.targetWeight = this.ruleForm.weight;
        }
      }
    },
    symptomChange(val) {
      if (val.includes("其他")) {
        this.showSymptomOther = true;
      } else {
        this.showSymptomOther = false;
      }
    },
    //切换高血压处理
    issymptomChange(val) {
      if (this.dTobj1 && this.dTobj != this.dTobj1) {
        this.$confirm(`居民历史病种为${this.dTobj1}，是否确定修改`, "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.ruleForm.issymptom = val;
          })
          .catch(() => {
            this.ruleForm.issymptom = !val;
            this.ruleForm.symptomHypertension = [];
            this.ruleForm.saltRelated = "";
            this.ruleForm.targetRelated = "";
          });
      }
      if (val) {
        if (this.ruleForm.symptomHypertension.length == 0) {
          this.ruleForm.symptomHypertension = ["无症状"]; 
        }
        this.ruleForm.saltRelated = "轻";
        this.ruleForm.targetRelated = "轻";
        this.ruleForm.nextFollowTimeHypertension = this.calculateFutureDate(3);
      } else {
        this.ruleForm.symptomHypertension = [];
        this.ruleForm.saltRelated = "";
        this.ruleForm.targetRelated = "";
        this.ruleForm.nextFollowTimeHypertension =""
      }
    },
    //切换糖尿病处理
    issymptomsDiabetesChange(val) {
      if (this.dTobj1 && this.dTobj != this.dTobj1) {
        this.$confirm(`居民历史病种为${this.dTobj1}，是否确定修改`, "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.ruleForm.issymptomsDiabetes = val;
          })
          .catch(() => {
            this.ruleForm.issymptomsDiabetes = !val;
            this.ruleForm.arteryPulsation = "";
            this.ruleForm.classFollowDiabetes = "";
            this.ruleForm.hypoglycemicReactions = "";
            this.ruleForm.classFollowDiabetes="";
          });
      }
      if (val) {
        if (this.ruleForm.symptomsDiabetes.length == 0) {
          this.ruleForm.symptomsDiabetes = ["无症状"];
        }
        this.ruleForm.arteryPulsation = "触及正常";
        this.ruleForm.classFollowDiabetes = "控制满意";
        this.ruleForm.hypoglycemicReactions = "无";
        this.ruleForm.nextFollowTimeDiabetes = this.calculateFutureDate(3);
      } else {
        this.ruleForm.symptomsDiabetes = [];
        this.ruleForm.arteryPulsation = "";
        this.ruleForm.classFollowDiabetes = "";
        this.ruleForm.hypoglycemicReactions = "";
        this.ruleForm.nextFollowTimeDiabetes="";
      }
    },
    symptomChange1() {
      this.ruleForm.symptomHypertension = ["无症状"];
      this.showSymptomOther = false;
    },
    symptomsDiabetesChange(val) {
      if (val.includes("其他")) {
        this.showSymptomsDiabetesOther = true;
      } else {
        this.showSymptomsDiabetesOther = false;
      }
    },
    symptomsDiabetesChangewu() {
      this.ruleForm.symptomsDiabetes = ["无症状"];
      this.showSymptomsDiabetesOther = false;
    },
    syChange() {
      this.ruleForm.symptomHypertension =
        this.ruleForm.symptomHypertension.filter((item) => item !== "无症状");
    },
    syChange1() {
      this.ruleForm.symptomsDiabetes = this.ruleForm.symptomsDiabetes.filter(
        (item) => item !== "无症状"
      );
    },

    /**
     * 获取关注记录
     * 该方法通过发送POST请求来检索关注记录，基于当前的页码和尺寸进行筛选。
     * 请求携带的数据包括表单内各项的值（如果有）以及分页信息（size和page）。
     * 请求成功后，更新表格数据和总记录数。
     */
    getRecord() {
      // followBeginTime:"",
      // followEndTime:"",
      // nextFollowBeginTime:"",
      // nextFollowEndTime:""
      // 准备请求数据，初始为空对象，然后遍历表单数据添加到requestData
      const requestData = {};
      for (const key in this.formInline) {
        if (this.formInline[key]) {
          requestData[key] = this.formInline[key];
          if (key === "followTime") {
            requestData.followBeginTime = this.formInline.followTime[0];
            requestData.followEndTime = this.formInline.followTime[1];
          }
          if (key === "createTime") {
            requestData.startTime = this.formInline.createTime[0];
            requestData.endTime = this.formInline.createTime[1];
          }
          if (key === "nextFollowTimeHypertension") {
            requestData.nextFollowBeginTime =
              this.formInline.nextFollowTimeHypertension[0];
            requestData.nextFollowEndTime =
              this.formInline.nextFollowTimeHypertension[1];
          }
        }
      }
      delete requestData.followTime;
      delete requestData.nextFollowTimeHypertension;
      delete requestData.createTime;

      // 添加分页信息到requestData
      requestData.size = this.size;
      requestData.page = this.currentPage;

      // 发送POST请求获取关注记录
      http.post("/followRecord/searchFollowRecord", requestData).then((res) => {
        // 更新表格数据和总记录数
        this.tableData = res.data.list;

        // taskScheduler(res.data.data,arr=>{
        //   let arrFreeze=Object.freeze(arr);
        //   this.tableData.push(...arrFreeze);
        // },8,10).then(()=>{
        //   this.tableLoading = false;
        // })
        this.total = res.data.total;
      });
    },
    onBack() {
      window.location.href = "/";
    },
    onSubmit() {
      this.$refs.formInline.validate((valid) => {
        if (valid) {
          this.currentPage = 1;
          this.getRecord();
        }
      });
    },
    onReset(formName) {
      this.$refs[formName].resetFields();
      this.formInline.endTime = "";
      this.formInline.startTime = "";
      this.currentPage = 1;
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
      if (val.length == this.total || val.length == this.size) {
        this.checkedAll = true;
        this.selectionCount = val.length;
      } else {
        this.checkedAll = false;
        this.selectionCount = 0;
      }
    },
    showRow(index) {
      this.people = this.tableData[index];
      delete this.people.followRecordStatus;
      this.people.referralInstitution =
        this.tableData[index].referralInstitution || "";
      this.ruleForm = {
        ...this.people,
        followTypeOther: "",
        symptomOther: "",
        symptomsDiabetesOther: "",
        targetStapleFood: this.people.targetStapleFood
          ? this.people.targetStapleFood
          : "",
        glycosylatedHemoglobin: this.people.glycosylatedHemoglobin
          ? this.people.glycosylatedHemoglobin
          : "",
        issymptom: !!this.people.symptomHypertension,
        issymptomsDiabetes: !!this.people.symptomsDiabetes,
        arteryPulsation: this.people.arteryPulsation
          ? this.people.arteryPulsation
          : "",
        isreferral: !(
          this.people?.referralReason == "无" &&
          this.people?.referralInstitution == "无"
        ),
      };
      this.dTobj1 = this.people.diseaseType ?? "";

      // 随访类型其他处理
      if (this.people.followType && this.people.followType.includes("其他")) {
        this.ruleForm.followType = this.people.followType.split("-")[0];
        this.ruleForm.followTypeOther =
          this.people.followType.split("-")[1] !== undefined
            ? this.people.followType.split("-")[1]
            : "";
      }

      // 高血压症状其他处理
      if (
        this.people.symptomHypertension &&
        this.people.symptomHypertension.includes("其他")
      ) {
        this.ruleForm.symptomHypertension = this.people.symptomHypertension
          .split("-")[0]
          .split(",");
        this.ruleForm.symptomOther =
          this.people.symptomHypertension.split("-")[1] !== undefined
            ? this.people.symptomHypertension.split("-")[1]
            : "";
        this.showSymptomOther = true;
      } else {
        this.ruleForm.symptomHypertension = this.people.symptomHypertension
          ? this.people.symptomHypertension.split(",")
          : [];
      }
      // 糖尿病症状其他处理
      if (
        this.people.symptomsDiabetes &&
        this.people.symptomsDiabetes.includes("其他")
      ) {
        this.ruleForm.symptomsDiabetes = this.people.symptomsDiabetes
          .split("-")[0]
          .split(",");
        this.ruleForm.symptomsDiabetesOther =
          this.people.symptomsDiabetes.split("-")[1]
            ? this.people.symptomsDiabetes.split("-")[1]
            : "";
        this.showSymptomsDiabetesOther = true;
      } else {
        this.ruleForm.symptomsDiabetes = this.people.symptomsDiabetes
          ? this.people.symptomsDiabetes.split(",")
          : [];
      }
      // 药品处理
      let drugArr = [];
      if (
        this.people.medicationSituation &&
        this.people.medicationSituation !== "无"
      ) {
        drugArr = JSON.parse(this.people.medicationSituation);
      }
      let insulinArr = [];
      if (this.people.insulin && this.people.insulin !== "无") {
        insulinArr = JSON.parse(this.people.insulin);
      }
      this.drugValidateForm.drugs = drugArr;
      this.insulinValidateForm.insulins = insulinArr;
      this.dialogDescVisible = true;
      setTimeout(() => {
        this.$refs.ruleForm.validate((valid) => {});
      }, 500);
    },
    deleRow(index) {
      const id = this.tableData[index].id;
      this.$confirm("此操作将删除该记录, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          http.post("/followRecord/delete", { id }).then((res) => {
            if (res.code === 200) {
              this.getRecord();
              ElMessage.success(res.message);
            }
          });
        })
        .catch(() => {});
    },
    saveRecord() {
      const that = this;
      let requestBody = {};
      this.$refs.ruleForm.validate((valid, fields) => {
        if (valid) {
          if (!that.ruleForm.issymptom && !that.ruleForm.issymptomsDiabetes) {
            ElMessage.warning("高血压和糖尿病至少选一样！");
            document.getElementById("bz").scrollIntoView();
            return false;
          }
          if (
            that.ruleForm.issymptom &&
            !that.ruleForm.symptomHypertension.length
          ) {
            ElMessage.warning("请选择高血压症状");
            document.getElementById("bz").scrollIntoView();
            return false;
          }
          if (
            that.ruleForm.issymptomsDiabetes &&
            !that.ruleForm.symptomsDiabetes.length
          ) {
            ElMessage.warning("请选择糖尿病症状");
            document.getElementById("bz").scrollIntoView();
            return false;
          }
          if (
            that.ruleForm.issymptomsDiabetes &
              !that.ruleForm.fastingBloodGlucose &&
            !that.ruleForm.randomBloodGlucose
          ) {
            ElMessage.warning("空腹血糖和随机血糖至少填写一个");
            document.getElementById("issympt").scrollIntoView();
            return;
          }
          that.$refs.drugValidateForm.validate((valid5) => {
            if (valid5) {
              that.$refs.insulinValidateForm.validate((valid6) => {
                if (valid6) {
                  // (that.ruleForm.nextFollowTimeHypertension =
                  //   that.ruleForm.nextFollowTimeHypertension),
                  //   (that.ruleForm.nextFollowTimeDiabetes =
                  //     that.ruleForm.nextFollowTimeDiabetes);
                  requestBody = {
                    ...that.ruleForm,
                    referralReason: that.ruleForm.isreferral
                      ? that.ruleForm.referralReason
                      : "无",
                    referralInstitution: that.ruleForm.isreferral
                      ? that.ruleForm.referralInstitution
                      : "无",
                    followType: that.ruleForm.followType
                      ? that.ruleForm.followType.replace(
                          "其他",
                          "其他-" + that.ruleForm.followTypeOther
                        )
                      : that.ruleForm.followType,
                    symptomHypertension: that.ruleForm.issymptom
                      ? that.ruleForm.symptomHypertension
                          .join(",")
                          .replace("其他", "其他-" + that.ruleForm.symptomOther)
                      : "",
                    bloodPressure: that.ruleForm.bloodPressure,
                    symptomsDiabetes: that.ruleForm.issymptomsDiabetes
                      ? that.ruleForm.symptomsDiabetes
                          .join(",")
                          .replace(
                            "其他",
                            "其他-" + that.ruleForm.symptomsDiabetesOther
                          )
                      : "",
                    arteryPulsation: that.ruleForm.arteryPulsation,
                    // motion: [
                    //   that.ruleForm.dailyExerciseFrequency,
                    //   that.ruleForm.dailyExerciseTime,
                    // ].join(","),
                    // targetMotion: [
                    //   that.ruleForm.targetExerciseFrequency,
                    //   that.ruleForm.targetExerciseTime,
                    // ].join(","),
                    medicationSituation: that.arrToStr(
                      that.drugValidateForm.drugs
                    ),
                    insulin: that.arrToStr(that.insulinValidateForm.insulins),
                    diseaseType: this.dTobj,
                  };
                  delete requestBody.isreferral;
                  delete requestBody.followTypeOther;
                  delete requestBody.issymptom;
                  delete requestBody.issymptomsDiabetes;
                  delete requestBody.symptomOther;
                  // delete requestBody.symptomsDiabetesOther;
                  // delete requestBody.dailyExerciseFrequency;
                  // delete requestBody.dailyExerciseTime;
                  // delete requestBody.targetExerciseFrequency;
                  // delete requestBody.targetExerciseTime;
                  // console.log(that.requestData)

                  http
                    .post("/followRecord/updateFollowRecord", requestBody)
                    .then((res) => {
                      if (res.code !== 200) return;
                      ElMessage.success(res.message);
                      that.dialogDescVisible = false;
                      that.$refs.ruleForm.resetFields();
                      that.$refs.drugValidateForm.resetFields();
                      that.$refs.insulinValidateForm.resetFields();
                      that.getRecord();
                      setTimeout(() => {
                        that.getRecord();
                      }, 10 * 1000);
                    });
                }
              });
            }
          });
        } else {
          console.log(fields);
          this.errlenght = Object.keys(fields).length;
          this.$message({
            type: "error",
            message: `您有${this.errlenght}必填项未填写`,
          });
        }
      });
    },
    arrToStr(arr) {
      // const returnArr = []
      if (arr.length) {
        // arr.forEach(v => {
        //   returnArr.push(v.name + ',' + v.method + ',' + v.usage)
        // })
        // return returnArr.join(';')
        return JSON.stringify(arr);
      } else {
        return "无";
      }
    },
    handleSizeChange(val) {
      // console.log(`每页 ${val} 条`);
      this.size = val;
      this.getRecord();
    },
    handleCurrentChange(val) {
      // console.log(`当前页: ${val}`);
      this.currentPage = val;
      this.getRecord();
    },
    showUpload() {
      const upArr = [];
      const that = this;
      const arrTrue = this.multipleSelection.every((item) => {
        return item.backFillingStatus !== "已人工回填";
      });
      const arrTrue2 = this.multipleSelection.every((item) => {
        return item.collectStatus == "采集成功";
      });
      if (arrTrue && arrTrue2) {
        this.multipleSelection.forEach((v) => {
          let cardNumber = v.cardNumber?.replace(/[\t\r].*/, "");
          let cardType = v.cardType?.replace(/[\t\r].*/, "");
          let name = v.name?.replace(/[\t\r].*/, "");
          upArr.push({
            id: v.id,
            cardNumber: cardNumber,
            cardType: cardType,
            createTime: v.createTime,
            diseaseType: v.diseaseType,
            name: name,
            // inputPerson: v.inputPerson,
            callType: "ChronicDiseaseBackFilling",
            flowType: "backFilling",
            inputPerson: v.inputPerson,
            submitter: getUserName(),
            firstPriority: 2,
            secondPriority: 1,
          });
        });

        http
          .post("/collectAndBackFilling/submit", upArr, { timeout: 10800000 })
          .then((res) => {
            if (res.code == 200) {
              // loading.close();
              ElMessage.success(res.message);
              that.multipleSelection = [];
              this.checkedAll = false;
              that.getRecord();
            }
          })
          .catch((err) => {
            console.log(err);
            // loading.close();
          });
      } else {
        ElMessage.error("存在未采集成功或已人工回填数据不可操作");
      }
    },
    testSt() {
      const that = this;
      const upArr = [];
      this.multipleSelection.forEach((v) => {
        let cardNumber = v.cardNumber?.replace(/[\t\r].*/, "");
        let cardType = v.cardType?.replace(/[\t\r].*/, "");
        let name = v.name?.replace(/[\t\r].*/, "");
        upArr.push({
          cardNumber: cardNumber,
          cardType: cardType,
          createTime: v.createTime,
          diseaseType: v.diseaseType,
          id: v.id,
          name: name,
          callType: "ChronicDiseaseCollect",
          flowType: "collect",
          inputPerson: v.inputPerson,
          submitter: getUserName(),
          firstPriority: 2,
          secondPriority: 1,
        });
      });

      http
        .post("/collectAndBackFilling/submit", upArr, { timeout: 10800000 })
        .then((res) => {
          if (res.code === 200) {
            ElMessage.success(res.message);
            // loading.close();
            that.multipleSelection = [];
            this.checkedAll = false;
            that.getRecord();
          }
        })
        .catch((err) => {
          console.log(err);
          // loading.close();
        });
    },
    //人工回填
    manualBackfilling() {
      const upArr = [];
      this.multipleSelection.forEach((item) => {
        upArr.push({
          id: item.id,
        });
      });
      const arrTrue = this.multipleSelection.every((item) => {
        return item.collectStatus !== "未采集";
      });
      const arrTrue2 = this.multipleSelection.every((item) => {
        return item.backFillingStatus !== "回填成功";
      });

      if (arrTrue && arrTrue2) {
        http
          .post("/followRecord/manuallyProcessed", upArr)
          .then((res) => {
            if (res.code == 200) {
              ElMessage.success(res.data);
              this.getRecord();
              this.multipleSelection = [];
              this.checkedAll = false;
              this.$refs.multipleTableRef.clearSelection();
            } else {
            }
          })
          .catch((err) => {});
      } else {
        ElMessage.error("存在未采集数据或回填成功数据时不可操作");
      }
    },
    exportSelect() {
      // const upArr = [];
      // this.multipleSelection.forEach((v) => {
      //   upArr.push({
      //     cardNumber: v.cardNumber,
      //     createTime: v.createTime,
      //     diseaseType: v.diseaseType,
      //   });
      // });
      // http.post("/followRecord/downLoad", upArr).then((res) => {
      //   if ((res.code = 200)) {
      //     this.checkedAll = false;
      //     this.multipleSelection = [];
      //     this.$refs.multipleTableRef.clearSelection();
      //     window.open(res.data);
      //   }
      // });
      const upArr = [];
      const showArr = this.columns.reduce((acc, column) => {
        acc[column.label] = column.visible;
        return acc;
      }, {});
      this.multipleSelection.forEach((v) => {
        upArr.push({
          cardNumber: v.cardNumber,
          createTime: v.createTime,
          diseaseType: v.diseaseType,
          id: v.id,
        });
      });
      const requestData = {
        followRecords: upArr,
        fieldList: showArr,
      };
      http.post("/followRecord/download", requestData).then((res) => {
        if (res.code === 200) {
          console.log("执行了");
          window.open(res.data);
          this.checkedAll = false;
          this.multipleSelection = [];
          this.$refs.multipleTableRef.clearSelection();
        } else {
          return;
        }
      });
    },
    exportRecord() {
      http.post("/followRecord/downLoadAll").then((res) => {
        if (res.code === 200) {
          // this.checkedAll=false;
          // 创建一个a标签
        }
        window.open(res.data);
      });
    },
    submitUpload() {
      this.$refs.upload.submit();
    },
    handleRemove(file, fileList) {
      // console.log(file, fileList);
    },
    handlePreview(file) {
      // console.log(file);
    },
    remoteMethod(query) {
      if (query !== "") {
        // this.loading = true;
        setTimeout(() => {
          // this.loading = false;
          this.options = this.list.filter((item) => {
            return item.label.toLowerCase().includes(query.toLowerCase());
          });
        }, 200);
      } else {
        this.options = [];
      }
    },
    removeDrug(item) {
      const index = this.drugValidateForm.drugs.indexOf(item);
      if (index !== -1) {
        this.drugValidateForm.drugs.splice(index, 1);
      }
    },
    addDrug() {
      if (this.drugValidateForm.drugs.length < 10) {
        this.drugValidateForm.drugs.unshift({
          药品名称: "",
          用药类型: "外院",
          天: "",
          次: "",
          用量: "",
          单位: "",
          key: Date.now(),
        });
      }
    },
    removeInsulin(item) {
      const index = this.insulinValidateForm.insulins.indexOf(item);
      if (index !== -1) {
        this.insulinValidateForm.insulins.splice(index, 1);
      }
    },
    addInsulin() {
      if (this.insulinValidateForm.insulins.length < 10) {
        this.insulinValidateForm.insulins.unshift({
          药品名称: "",
          用药类型: "外院",
          用法: "皮下注射",
          // 天: "",
          // 次: "",
          用量: "",
          // 单位: "",
          key: Date.now(),
        });
      }
    },
  },
  computed: {
    getFollowWay() {
      if (this.ruleForm.followWay !== "门诊") {
        return true;
      } else {
        return false;
      }
    },
    iszzz() {
      const { iszz1, iszz2, iszz3, iszz4, iszz5, iszz6 } = this.iszz;
      return {
        iszz1,
        iszz2,
        iszz3,
        iszz4,
        iszz5,
        iszz6,
      };
    },
    age() {
      const i = this.ruleForm.birthday.split("-")[0];
      return new Date().getFullYear() + "" - i;
    },
    createTime() {
      const { createTime } = this.formInline;
      return {
        createTime,
      };
    },
    getform() {
      const {
        issymptom,
        issymptomsDiabetes,
        arteryPulsation,
        heartRate,
        height,
        weight,
        targetWeight,
        waist,
      } = this.ruleForm;
      return {
        issymptom,
        issymptomsDiabetes,
        arteryPulsation,
        heartRate,
        height,
        weight,
        targetWeight,
        waist,
      };
    },
    dtob() {
      const { issymptom, issymptomsDiabetes, arteryPulsation } = this.ruleForm;
      return {
        issymptom,
        issymptomsDiabetes,
      };
    },
  },
  watch: {
    isPopOpen: {
      handler: function () {
        if (this.isPopOpen) {
          this.searchQuest();
        }
      },
    },
    createTime: {
      handler: function () {
        if (
          this.formInline.createTime &&
          this.formInline.createTime.length > 0
        ) {
          // this.formInline.createTime=this.formInline.createTime.toString();
        }
      },
    },
    iszzz: {
      handler: function () {
        if (
          this.iszz.iszz1 ||
          this.iszz.iszz2 ||
          this.iszz.iszz3 ||
          this.iszz.iszz4 ||
          this.iszz.iszz5 ||
          this.iszz.iszz6
        ) {
          this.ruleForm.isreferral = true;
        } else {
          this.ruleForm.isreferral = false;
        }
      },
    },
    dtob: {
      handler: function () {
        if (this.ruleForm.issymptom && !this.ruleForm.isdiabetes) {
          this.dTobj = "高血压";
        }
        if (this.ruleForm.issymptomsDiabetes && !this.ruleForm.isdiabetes) {
          this.dTobj = "糖尿病";
        }

        if (this.ruleForm.issymptom && this.ruleForm.issymptomsDiabetes) {
          this.dTobj = "高糖";
        }
      },
    },
    getform: {
      handler: function (val) {
        if (
          this.ruleForm.issymptom == true &&
          this.ruleForm.issymptomsDiabetes == false
        ) {
          this.isxshow = false;
        } else {
          this.isxshow = true;
        }
        if (
          this.ruleForm.issymptomsDiabetes == true &&
          this.ruleForm.issymptom == false
        ) {
          this.isgshow = false;
        } else {
          this.isgshow = true;
        }
        const { heartRate } = val;
        if (heartRate > 100) {
          this.iszzz.iszz5 = true;
        } else {
          this.iszzz.iszz5 = false;
        }
        if (
          this.ruleForm.arteryPulsation &&
          this.ruleForm.arteryPulsation !== "触及正常"
        ) {
          this.$message({
            type: "error",
            message: "足背动脉搏动减弱或消失，需紧急转诊",
          });
          this.iszz.iszz6 = true;
        } else {
          this.iszz.iszz6 = false;
        }
        if (
          this.ruleForm.waist >= 90 ||
          (this.ruleForm.gender == "男" && this.ruleForm.waist >= 90) ||
          (this.ruleForm.gender == "女" && this.ruleForm.waist >= 85)
        ) {
          if (
            this.ruleForm.targetWeight &&
            this.ruleForm.targetWeight == this.ruleForm.weight
          ) {
            this.ruleForm.targetWeight = this.ruleForm.weight * 0.95;
          }
        } else {
          if (this.ruleForm.weight && this.ruleForm.height) {
            const bmi = (
              (this.ruleForm.weight /
                (this.ruleForm.height * this.ruleForm.height)) *
              10000
            ).toFixed(2);
            //@ts-ignore
            if (bmi >= 24) {
              this.ruleForm.targetWeight =
                Math.round(this.ruleForm.weight * 9.5) / 10;
              //@ts-ignore
            } else if (bmi < 18.5) {
              this.ruleForm.targetWeight =
                Math.round(this.ruleForm.weight * 10.5) / 10;
            } else {
              this.ruleForm.targetWeight = this.ruleForm.weight;
            }
          }
        }
      },
    },
  },
};
</script>
<style lang="scss" scoped>
:deep(.el-input__wrapper) {
  width: 230px;
}
:deep(.el-form-item .el-select__wrapper) {
  min-height: 32px;
  width: 252px;
}
:deep(.codeTypeInput .el-select__wrapper) {
  width: 100% !important;
}
:deep(.el-range-editor--large.el-input__wrapper) {
  height: 32px;
  width: 252px;
}
/* 为选择列的单元格设置文本溢出隐藏，确保内容不显示省略号 */
.el-table-column--selection .cell {
  text-overflow: clip !important;
}

.page {
  padding: 10px 20px;
  width: 100%;
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0;
  background: #fff;
}
.el-header {
  background: #4485dd;
  color: #fff;
}
.popover-container {
  display: flex;
  justify-content: end;
  position: relative;
}
.arrow-container {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.arrow {
  font-size: 23px;
  color: #409eff;
  margin-right: 8px;
  transition: transform 0.3s;
}

.rotate {
  transform: rotate(180deg); /* 点击后箭头旋转 */
}
.arrow-container:hover .arrow {
  color: #ff9f43; /* 悬停时箭头颜色变为橙色 */
}
.popover-item-list {
  border-radius: 10px;
  padding: 10px;
}
.popover-content-list {
  padding: 5px;
  background-color: rgba(255, 255, 255, 0.2); /* 背景透明 */
  border: 2px solid #409eff; /* 默认边框颜色 */
  border-radius: 10px;
  transition: border-color 0.3s ease; /* 边框颜色变化动画 */
}
.popover-content-list:hover {
  border-color: #ff9f43; /* 悬停时边框颜色变为橙色 */
}
.gradient-text {
  background: linear-gradient(45deg, #409eff, #ff9f43);
  -webkit-background-clip: text;
  color: transparent;
  font-weight: bold;
  transition: background 0.5s ease;
}
.timebox {
  background-color: #f5f7fa;
  color: #909399;
  vertical-align: middle;
  display: table-cell;
  position: relative;
  border: 1px solid #dcdfe6;
  border-right: none;
  /* border-radius: 4px; */
  padding: 0 20px;
  width: 99px;
  white-space: nowrap;
  height: 40px;
  text-align: center;
  font-size: 16px;
  line-height: 40px;
}
:deep(.dialog-box .el-form--label-top .el-form-item .el-form-item__label) {
  font-size: 16px !important;
}
:deep(.dialog-box .el-input-group__prepend) {
  height: 42px;
  width: 105px;
}
:deep(.dialog-box .el-input-group__append) {
  height: 42px;
  width: 55px;
}

:deep(.dialog-box .el-input__wrapper) {
  height: 40px !important;
}

:deep(.dialog-box .el-form-item .el-select__wrapper) {
  min-height: 42px;
}
.isPoposhow {
  height: 100px;
  width: 100px;
}
// .popover-content {
//   position: absolute;
//   right: 65px;
//   top: 18px;
//   z-index: 99;
// }
.setting {
  position: absolute;
  right: 65px;
  top: 12px;
  z-index: 99;
  font-size: 16px;
  cursor: pointer;
}
.popover-content-list .el-popover {
  right: 40px;
}
.el-popover {
  min-width: 115px !important;
}

.popover-item {
  width: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  height: 300px;
}
.popover-item-list {
  width: 100%;
  height: 150px;
  box-sizing: border-box;
  padding: 10px;
}
.item-titel {
  margin-top: 10px;
  font-weight: 600;
  font-size: 14px;
}
.popover-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}
h1 {
  font-size: 14px;
  text-align: left;
  padding: 0;
}
h2 {
  font-size: 18px;
}
h3 {
  margin: 0;
}
h4 {
  font-size: 16px;
}
.el-main {
  padding: 0;
  height: calc(100vh - 74px);
}
.main-top {
  height: 50px;
  text-align: right;
  border-bottom: 1px solid #f1f1f1;
}
.main-top .el-button {
  height: 50px;
  width: 120px;
  font-size: 20px;
}
.main-filter {
  padding: 0 20px;
  border-bottom: 1px solid #f1f1f1;
}
.op {
  padding: 20px;
}
.op h4 {
  margin: 0;
  padding: 0;
}
.tr {
  text-align: right;
}
.tb {
  position: relative;
  // padding: 0 20px;
  overflow: hidden;
  margin-top: 1vw;
}
.el-dialog__body {
  padding: 10px;
}
.el-table .cell {
  box-sizing: border-box;
  padding-left: 10px;
  padding-right: 10px;
  /* text-overflow: ellipsis; */
  /* word-break: break-all; */
}
// #formbox {
//   width: 80vw !important;
// }
#formbox {
  display: flex;
  flex-wrap: wrap;
  padding: 0 30px;
}
.el-collapse {
  border-left: 1px solid #ebeef5;
  border-right: 1px solid #ebeef5;
}
.el-collapse-item__header {
  padding-left: 10px;
}
.mb10 {
  margin-bottom: 10px;
}
.mt20 {
  margin-top: 20px;
}
.el-radio,
.el-checkbox {
  /* display: block; */
  padding: 5px 10px;
}
.el-radio {
  padding: 0px 20px 0px 10px !important;
}
.el-radio:hover,
.el-checkbox:hover {
  background: #f1f1f1;
}
.el-radio-n {
  display: inline-block;
  padding: 0;
  height: 40px;
}
.el-collapse-item__content {
  padding-bottom: 0;
}
.el-radio-group {
  display: block;
}
.tableAuto.el-table .cell {
  white-space: nowrap;
}
.name-wrapper span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 15px;
  display: none;
}
.name-wrapper2 span {
  background: #ff0000;
  display: inline-block;
  color: #ff0000;
}
.name-wrapper1 span {
  background: #ec7f2c;
  display: inline-block;
  color: #ec7f2c;
}
.el-dialog .el-tabs__item,
.el-dialog .el-input,
.el-dialog .el-radio__label,
.el-dialog .el-checkbox,
.el-dialog .el-checkbox__label,
.el-dialog .el-collapse-item__header,
.el-dialog .el-form-item__label {
  font-size: 16px;
}
.el-dialog .el-button--small {
  font-size: 14px;
}
.el-form--label-top .el-form-item__label {
  padding: 0;
}
.el-form-item {
  margin-bottom: 20px;
}
.border {
  border: 1px solid #f1f1f1;
  margin-bottom: 0;
}
/* .gender {
  margin-right: 28vw !important;
}
.time_selector {
  margin-right: 28vw !important;
}

.diseases {
  margin-right: 40px !important;
} */
.createTime {
  display: flex;
}
.createTime .el-date-editor.el-input,
.el-date-editor.el-input__inner {
  width: 150px;
}
.nextime {
  margin-right: 6vw !important;
}
.tip {
  font-size: 12px;
  color: red;
  z-index: 9;
}
.tab_se {
  box-sizing: border-box;
  line-height: 23px;
  padding-left: 10px;
  padding-right: 10px;
  overflow: auto !important;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-all;
}
.dialog_footer {
  margin-top: 20px;
  display: flex;
  justify-content: end;
}
.table-btn {
  display: flex;
  height: 50px;
  align-items: center;
  justify-content: space-around;
}
</style>
